Reputation: 20633
I created a new route, like this:
resources :animals do
member do
get ':id/resumed_rep_life', :action => 'resumed_rep_life'
end
end
match '/animals/:id/resumed_rep_life' => "animals#resumed_rep_life"
How can I made a link for it?
I tried resumed_rep_life_animal_path(animal)
but it does not work (method not found).
Are my routing correct?
Upvotes: 3
Views: 761
Reputation: 3376
Change this line:
match '/animals/:id/resumed_rep_life' => "animals#resumed_rep_life"
to this:
match '/animals/:id/resumed_rep_life' => "animals#resumed_rep_life", :as => 'resumed_rep_life_animal'
Upvotes: 4