Available for hire
Raw Output of Html in Rails3

As of rails3 the <%=h tag is now applied by default to all of your <%= @content So for instance in a message:

1
2
3
4
5
# Controller
@message = "Unfortunately an error occurred: Sorry, this product is no longer available, if you think you received this in error, please [contact us](/contact/us)"

# View
= @message

would result in Unfortunately an error occurred: Sorry, this product is no longer available, if you think you received this in error, please <a href='/contact/us'>contact us</a> To remove htmlentities being sanitized you can use the raw() method helper

1
2
3
4
5
# Controller
@message = "Unfortunately an error occurred: Sorry, this product is no longer available, if you think you received this in error, please [contact us](/contact/us)"

# View
=raw @message

would result in Unfortunately an error occurred: Sorry, this product is no longer available, if you think you received this in error, please [contact us](/contact/us) Be careful how you use this, if @message was set from user input, than they could inject some nasty javascript or flash in your page.