I'm working on a simple reservation application. Here are my routes
resources :users do
get 'reservations', on: :member
end
resources :listings do
resources :reservations
end
When I try to make a reservation, action reservations#new
takes me to reservations_path
. Of course I'm getting error as this path doesn't exist. I'd like action new
to take me to listing_reservations_path
instead. I was hopping it will be done automatically since resources :reservations
is in nested resources. I read about routes and tried many things but can't find any working way of doing it. Is it possible?