0

I am trying to change the param in my nested resource but for some reason it add the name of the parent resource

routes.rb

  resources :users, path: 're', param: :username do
    resource :profile
  end

this is how my routes are looking right now

user_profile POST   /re/:user_username/profile(.:format)      profiles#create
    new_user_profile GET    /re/:user_username/profile/new(.:format)  profiles#new
   edit_user_profile GET    /re/:user_username/profile/edit(.:format) profiles#edit
                     GET    /re/:user_username/profile(.:format)      profiles#show
                     PATCH  /re/:user_username/profile(.:format)      profiles#update
                     PUT    /re/:user_username/profile(.:format)      profiles#update
                     DELETE /re/:user_username/profile(.:format)      profiles#destroy
               users GET    /re(.:format)                             users#index
                     POST   /re(.:format)                             users#create
            new_user GET    /re/new(.:format)                         users#new
           edit_user GET    /re/:username/edit(.:format)              users#edit
                user GET    /re/:username(.:format)                   users#show
                     PATCH  /re/:username(.:format)                   users#update
                     PUT    /re/:username(.:format)                   users#update
                     DELETE /re/:username(.:format) 

How can I change /re/:user_username/profile/new(.:format) for /re/:username/profile/new(.:format)

Smita Ahinave
  • 1,901
  • 7
  • 23
  • 42
Javier Lopez
  • 191
  • 1
  • 6
  • 18

0 Answers0