Ruby on Rails <%= %> within a <%= link_to %> -
i'm new ruby on rails. i'm following guide using haml. don't haml i've skipped using that. problem i'm trying have <h2><%= forumthread.title %></h2>
link forumthread_path.
with haml set be: %h2= link_to forumthread.title, forumthread_path
how can achieve same result without haml?
thanks lot in advance!
i think want this:
<h2><%= link_to forumthread.title, forumthread_path(forumthread) %></h2>
which generate same thing as:
<h2><a href="<%= forumthread_path(forumthread) %>"><%= forumthread.title %></a></h2>
see link_to
documentation, first argument 'title' link, , second path link.
Comments
Post a Comment