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">&lt;span&gt;foo&lt;/span&gt;</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

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -