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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -