Ruby on Rails seems to be auto-escaping html created by link_to

后端 未结 4 701
遥遥无期
遥遥无期 2020-12-20 20:42

Here is my code, I\'m trying to display a list of links to a bboy\'s crews in sentence form with .to_sentence


    <% if         


        
4条回答
  •  死守一世寂寞
    2020-12-20 21:21

    Rails 3 now automatically escapes everything, in order to output raw HTML use this:

    <%= some_string.html_safe %>
    

    or this:

    <%= raw @some_html_string %>
    

    Thanks to macek for a hint.

    For additional details: http://markconnell.co.uk/posts/2010/02/rails-3-html-escaping

提交回复
热议问题