Reputation: 1
In my routes.rb I have:
resources :fire_preventions do
get 'search_adv', :on => :collection
end
How can I use it with inherited resources routes?
search_adv_collection_url doesn't work.
Upvotes: 0
Views: 1108
Reputation: 8111
You can execute rake routes
in comand line. It will print all available paths according to routes.rb
Upvotes: 1
Reputation: 3818
As there is only one route listed,
resources :fire_preventions do
get 'search_adv', :on => :collection
end
is shorten form for getting rid of the additional block
resources :fire_preventions do
collection do
get 'search_adv'
end
end
You should be able to use search_adv_fire_preventions_path
and search_adv_fire_preventions_url
. It's best that you perform rake routes
to check this.
Upvotes: 0