mercredi 13 avril 2016

Upgrading Rails 3.2 to 4.2.6, routes generates wrong pathnames for resources

I'm upgrading from Rails 3.2 to 4.2.6 and, for some reason, one model suddenly has it's rails generated resources path names all wrong. Resources for all the other models is working fine.

routes.rb (commented out all the other routes to isolate the faulty model)

Rails.application.routes.draw do
  resources :signups
end

rails 3.2 rake routes output (what it should look like)

signups     GET     /signups(.:format)          signups#index
            POST    /signups(.:format)          signups#create
new_signup  GET     /signups/new(.:format)      signups#new
edit_signup GET     /signups/:id/edit(.:format) signups#edit
signup      GET     /signups/:id(.:format)      signups#show
            PUT     /signups/:id(.:format)      signups#update
            DELETE  /signups/:id(.:format)      signups#destroy

rails 4.2.6 rake routes output

signups_index GET    /signups(.:format)          signups#index
              POST   /signups(.:format)          signups#create
  new_signups GET    /signups/new(.:format)      signups#new
 edit_signups GET    /signups/:id/edit(.:format) signups#edit
      signups GET    /signups/:id(.:format)      signups#show
              PATCH  /signups/:id(.:format)      signups#update
              PUT    /signups/:id(.:format)      signups#update
              DELETE /signups/:id(.:format)      signups#destroy

Any idea what could've caused this one model to have it's path name changed?

Aucun commentaire:

Enregistrer un commentaire