Nested dom nodes inside of link_to helper
so I see alot of this for adding nested html inside of links using Rails link_to
helper
= link_to raw("<span>fooo</foo>"), "url"
Just an FYI many rails helpers will take a block.
= link_to "url" do
%span foo
I much prefer the latter instead of inlining html as a string in the param.
Written by David Morrow
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#