Rails Views and Controllers Lesson
Today we are going to review a completed rails app: Todo App.
Todo App is a complete implementation of a CRUD.
The morning we will review the Todo App in detail.
The afternoon lesson will be a code along to create the Todo App.
We will analyze the todo_app in detail
We will follow how the Views and the Controller communicate together.
* We will follow a typical rails code development sequence.
We will learn some Rails commands used in the view
* form_for, link_to, button_to
Our focus will be on Views and Controllers. Of course we will need to have routes.
The database model code is stubbed out for us. We will leave the detailed discussion of the database creation and commands for tomorrows lesson.
At the end of the lesson, you should be able to:
* 1) Set up restful routes.
* 2) Set up a controller to interact with index, show, new, and edit pages.
* 3) Know what to implement on each view page (index, show, new, and edit).
* 4) How to setup and use a form_for, button_to and link_to rails commands.
* 5) How to set up Bootstrap in a rails app.
Get the completed todo_app. Clone it to your desktop.
###Todo App
Action: Run bundle install.
Action: Prepare the database
# migrate the database
bundle exec rake db:migrate
# seed the database
bundle exec rake db:seed
Action: Go to your terminal and start the server.
# start the server
rails s