Scaffolding in Rails
In this post, I try to explain scaffolding in rails shortly. Firstly, Let’s create rails project
1 2 |
|
Now, we created rails project and enter inside of project. We need to create scaffold,
1
|
|
- We create Information model, in this model
- Type of first_name and second_name is string.
- Type of date_time is date, this provide to create date.
- Type of city is boolean, this provide to create checkbox.
then we need to migrate for this reason,
1
|
|
Then, If you want change your home page(index.html), you should open in your app,
config/routes.rb
this path and write
root :to => 'information#index'
save and run
1
|
|
opened http://localhost:3000/
That’s all.