0

Here is my routes.rb:

Rails.application.routes.draw do
  devise_for :users
  root to: 'pages#home'
  resources :users, except: [ :delete ] do
    resources :bookings, except: [ :delete ]
    resources :reviews, except: [ :edit, :update, :delete ]
  end
  # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end

I'm getting "/users/1/bookings.3" but I want "/users/1/bookings/3". What do I need to do to achieve this?

fda3r
  • 13
  • 5
  • Potential duplicate of https://stackoverflow.com/q/16264981/544825 – max Apr 11 '21 at 16:20
  • You're probably doing `users_bookings_path(user, booking)` instead of `users_booking_path(user, booking)`. – max Apr 11 '21 at 16:22

1 Answers1

0

Try using user_bookings_path(user, booking).

Andrea
  • 137
  • 1
  • 6