I am converting my fat Rails2 application to run on Rails3. After a long intense fight with an army of bugs and my bosses yells, the page is all rendered as an escaped html string. So all the divs, images etc. are written literally for the user.
For some reason this call of a partial renders an escaped string
<%= render :partial => 'something_really_interesting' %>
As all Ruby on Rails application this instruction is not called very much! So how would I handle all these calls to not render normally not as an escaped string?
Use <%= raw bla %>
in inside the partial file.
Rails 3 automatically makes everything safe. You need to put raw
to escape the behavior. That also means you don't have to use h()
method to make your string safe any more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With