Scaffolding in Rails 2.0

--> Create a rails application from the command prompt C:\>rails testapp . It creates a rails directory structure with default database sqlite3.


--> Open the database.yml file under the config directory and change the default database details



--> Navigate to the rails application folder in the command prompt and generate scaffold using the following command.



--> We can add an extra field show timings to the movies table like following.


--> Open the add-time.rb file under the db/migrate folder of the rails application.


--> Migrate the database using rake db:migrate command to effect the changes to the database.


--> Run the application using the command ruby script/server at command prompt and start the browser point to the application



No comments: