scaffolding broken in Rails 2.1.0

Hi,

I trying to follow the tutorial in Agile Web Development with Rails Second Ed using Rails 2.1.0. So far I've overcome problems with missing scaffolding, missing classic_pagination, missing svn (required to install classic_pagination and no error messages about ) and default not being supported by MySQL in migrations.

The latest problem appears to be a bug in the scaffolding.

The http://localhost:3000/admin/new action churns out a form with a broken action url e.g:

<form method="post" action="/admin/%2Fadmin%2Fcreate">

If you hack the html with firebug to this:

<form method="post" action="/admin/create">

It works fine.

There appears to be a post about this in Korean here. http://forum.rubykr.org/viewtopic.php?t=6560 but I can't understand it.

Does anybody know how to fix this?

Thanks,

Alex

Please use the version of rails that is used in the book

Oscar Del Ben schrieb:

Please use the version of rails that is used in the book

Or buy the latest version of it: Agile Web Development with Rails 3rd Edition

Martin

Other people have suggested this, but what's the point of learning an obsolete version of rails when the new one is so different?

I've seen this is available but I've only just bought the 2nd ed!

It’s ok to have the second edition, that is a fantastic book, you only need to use the same version of the book. sudo gem install rails -v 1.2.6 should do the job.

Happy learning.

Not out until October.

But, you can get the Beta version PDF right now:

-Rob

But, you can get the Beta version PDF right now:

Pragmatic Bookshelf: By Developers, For Developers

Although if you don't know rails at all then working from a half done
book might be an exercise in frustation.

Fred

Alex Birkett wrote:

Please use the version of rails that is used in the book

Other people have suggested this, but what's the point of learning an obsolete version of rails when the new one is so different?

The new rails isn't as different as it seems - it's just that all the differences seem to be magnified by the scaffolding. The only real difference is the greater emphasis on restful routing, and some new conventions for controller actions. But like i say if you're using scaffolding it's very hard to follow.

In your case i'd recommend using the older version of rails to follow the tutorials. Then, find some RESTful rails tutorials on the net and follow them using the newer rails - you will stand a much better chance of understanding what you are doing.

If you bought it after XXX(see on their hp) you can get the new version for free.

Alex Birkett schrieb:

Thanks for your email.

I wouldn't take that for granted--send them an e-mail & ask. I've found them quite helpful...

Good luck!

The new rails isn't as different as it seems - it's just that all the differences seem to be magnified by the scaffolding. The only real difference is the greater emphasis on restful routing, and some new conventions for controller actions. But like i say if you're using scaffolding it's very hard to follow.

I've downloaded the source code for the 3rd ed. of the book and diffed it against the 2nd ed. It seems that the authors have taken the same approach as me: they've just called the controller 'products' instead of 'admin'. (presumably because the ror 2.x generate scaffold script forces the controller name to be the same as the model) So far so good ...