views:

14

answers:

1

I was wondering about how i can do this in rails

because i want something like

<a href="requests/13#new">Comment!<a>

anyone knows it?

greetings

+2  A: 
<%= link_to "Comment!", url_for(:controller => "requests", :action => "show", :id => 13, :anchor => "new") %>

If you are working with a Request object and a restful route.

<%= link_to "Comment!", request_path(@request, :anchor => "new") %>

More details are available in the link_to helper documentation.

Simone Carletti