Reputation: 6653
I have an link to the show action but I want it to go to the "edit" action
<%= link_to("Previous Post", @line.previous) if @line.previous %>
how do I change this to go to "edit" rather than "show"?
Upvotes: 0
Views: 89
Reputation: 12273
Something like the following. There are more examples at apidock
link_to "Previous Post", :controller => "profiles", :action => "edit", :id => @profile # => <a href="/profiles/edit/1">Previous Post</a>
Upvotes: 1