Thursday, February 24, 2011

"rake rails:upgrade:routes" create "postget" undefined method while upgrading from Rails 2.3.5 to 3.0.3

I am using "https://github.com/rails/rails_upgrade" plugin to analyze the files, actions, code that needs to be modified because of Rails upgradation.

I have routes as such:
map.resources :users, :collection=>{:billable=>[:post,:get]}
When ran the command "rake rails:upgrade:routes", it creates the new routes as :
resources :users do
  collection do
    postget :billable 
  end
end
Here, postget is undefined method.
To fix this, change the code as:
resources :users do
  collection do
    get :billable
    post :billable
  end
end

No comments:

Post a Comment