Hello:
I am learning to use Helpers in Rails 3.
I have a project model with 'Name' attribute in it. I want to display
all the Projects with a 'Show' link next to it. The Problem is instead
of displaying a link for 'Show' it is displaying the html(<a
href="/projects/1"><img alt="Show"
src="/images/icons/show.png?1285276800" /></a>
CODE:
--Here is my app/views/projects/index.html.erb
Its because with rails3 they have implemented script safety by
default. If you want to print html/script codes you need to
explicitly declare it. try this
Although this will work, it seems like bad form to do this for helpers in the view.
IMO, if the helper is intended to return renderable html, it should. Simply add .html_safe to
the end of .join() in your helper --> .join(' ').html_safe