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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -