I have a non-resourceful route that uses a SHA token in the route. Here it is in my routes.rb file:
match 'permissions/confirm/:token' => 'permissions#confirm'
I can access the generated route, but I don’t know what to pass in for the link_to helper.
Here is what I’m using for the link_to, which is not working:
<%= link_to "Give permission", confirm_permission_path(:token => @permission.token) %>
Thoughts?
Add
:askey to your route likematch 'permissions/confirm/:token' => 'permissions#confirm', :as => :confirm_permissionsThen
<%= link_to "Give permission", confirm_permissions_path(:token => @permission.token) %>