I have the following simplified helper which works:
module MyHelper
def widget
link_to new_flag_path do
content_tag(:i, '', class: "fa fa-flag")
end
end
end
I would like to output a second link such as:
module MyHelper
def widget
link_to new_flag_path do
content_tag(:i, '', class: "fa fa-flag")
end
link_to new_comment_path do
content_tag(:i, '', class: "fa fa-comment")
end
end
end
The solution outlined in the pugautomatic article uses "concat" to concatenate multiple helpers within a single block helper. http://thepugautomatic.com/2013/06/helpers/ This works for standard link_to helpers such as:
module MyHelper
def widget
concat link_to("Hello", hello_path)
concat " "
concat link_to("Bye", goodbye_path)
end
end
When using a glyphon in a href you need to use a link_to block helper such as:
link_to new_comment_path do
content_tag(:i, '', class: "fa fa-comment")
end
Concat does not allow me to concat multiple link_to block helpers such as:
module MyHelper
def widget
concat link_to new_flag_path do
content_tag(:i, '', class: "fa fa-flag")
end
concat link_to new_comment_path do
content_tag(:i, '', class: "fa fa-comment")
end
end
end
What is the solution in this scenario?
icon(:flag). just sayin