> I'm writing a helper to generate the display of a product and its > information as retrieved from the database. Several HTML tags are part > of this. > > As I'm building the string I want included in the HTML, Rails is > automatically escaping the string - which prevents me from actually > using the string I build. >h2< is *NOT* the same as <h2>. > > How can I prevent Rails from doing this?
def my_helper "<h2>my unsafe string</h2>".html_safe! end See http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails -philip -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

