tapioco123
tapioco123

Reputation: 3525

Migration to rails 3

I am migrating a rails 2.3.5 project to rails 3.

I get a lot of errors in the lines when i am using:

params[:something]

that i have to change ti with:

request.path_parameters[:something]

It this right? I am unable to found something about this in rails3 migration guides.

My controller:

def details
foo=Tag.find(params[:id])
end

and i get the following error:

ActiveRecord::RecordNotFound

Couldn't find Tag without an ID

Upvotes: 0

Views: 159

Answers (2)

cwadding
cwadding

Reputation: 870

Aside from your error, which is probably due to the missing : as tapioco123 pointed out, are you using the rails_upgrade plugin?

https://github.com/rails/rails_upgrade

There are also three excellent screencasts by Ryan Bates at railscasts on upgrading from rails 2.3.5 to 3.0.

http://railscasts.com/episodes?utf8=%E2%9C%93&search=upgrading+rails+3

This will help you switch over to some of the new features rails 3 offers and prepare you for rails 3.1 which is expected to be released soon and may not show all the depreciation messages that rails 3.0 will.

Good luck with upgrading.

Upvotes: 2

Peter Andersen
Peter Andersen

Reputation: 461

You are missing the ":" in params[:id].

That may be the reason you're receiving the error.

Upvotes: 4

Related Questions