How to display this span tag correctly in ruby? -
the following ruby code
content_tag(:li, render_menu_node(node, content_tag(:span, caption), url, selected)) displays span tag this:
<li><a href="" class="selected"><span>foo</span></a></li> how can make display this?
<li><a href="" class="selected"><span>foo</span></a></li>
if rails 3, use either
content_tag(:li, raw(render_menu_node(node, content_tag(:span, caption), url, selected))) or
content_tag(:li, render_menu_node(node, content_tag(:span, caption), url, selected).html_safe) or better modify render_menu_node return html_safe string. sure h user input inside method however.
you may need use 1 of these techniques inside method. make sure not wrapping content_tag(:span, caption) in h method call. post code more details.
if not rails 3, you'll need post source of method.
Comments
Post a Comment