Rails 3.0 RC2 was recently released and it seems that we are really close to the official launch of Rails 3.0

I ve got great news for those of you who have already been using the ActiveScaffold Plugin with previous Versions of Rails:

If you are interested in using Rails 3.0, you just can do it.

Let me guide you through the few steps to setup up a Rails 3 project with ActiveScaffold.

Setup Rails 3 project (detailled instructions):

  1. rails new howto
  2. cd howto
  3. bundle install
  4. rake db:create

Setup ActiveScaffold (you will need a running git bash):

  1. rails plugin install git://github.com/vhochstein/active_scaffold.git -r ‘rails-3.0′
  2. rails g active_scaffold_setup [prototype| jquery]

Your choice if you would like to use prototype or jquery. Thanks to Rails 3.0 and the new unobtrusive Javascript approach. If you are asked if you would like to overwrite rails.js just say yes.

Setup two activescaffolds:

  1. rails g active_scaffold Team name:string position:integer
  2. rails g active_scaffold Player name:string injured:boolean salary:decimal date_of_birth:date  team:references
  3. rake db:migrate
  4. edit file app/models/team.rb -> has_many :players
  5. rails s
  6. Open Browser: http://localhost:3000/teams

That ‘s it. You ve got a running application to CRUD teams and players using Rails 3 and ActiveScaffold.

About these ads