To apply the migration we execute:
Posted: Sat Feb 22, 2025 9:00 am
The migration file has two sections: up and down. Both are used to rollback changes made to the database, and migrations in Rails are versioned, so we can handle changes to the database schema.
$ rake db:migrate
At this point we can run our application again and we will have the functionality UAE Mobile Database to Create, View and Update events, this thanks to the fact that in the “scaffold” process we created the event controller in “app/controllers/event_controller.rb”, which defines 7 actions that follow the REST standard mentioned above:
Index
Show
New
Create
Edit
Update
Destroy
The controller is now fully functional. Note that the controller name follows a _controller convention, which like REST is also an established convention in Rails.
Just like the controller, the scaffold generated the views: index.html.erb, show.html.erb, new.html.erb, edit.html.erb, _form.html.erb. These are used by the controller to respond to actions, in fact it is no coincidence that the name of the views matches some of the controller actions.
$ rake db:migrate
At this point we can run our application again and we will have the functionality UAE Mobile Database to Create, View and Update events, this thanks to the fact that in the “scaffold” process we created the event controller in “app/controllers/event_controller.rb”, which defines 7 actions that follow the REST standard mentioned above:
Index
Show
New
Create
Edit
Update
Destroy
The controller is now fully functional. Note that the controller name follows a _controller convention, which like REST is also an established convention in Rails.
Just like the controller, the scaffold generated the views: index.html.erb, show.html.erb, new.html.erb, edit.html.erb, _form.html.erb. These are used by the controller to respond to actions, in fact it is no coincidence that the name of the views matches some of the controller actions.