Search code examples
ruby-on-railsscaffolding

What is Scaffolding


I am having a question on scaffolding. Can someone explain what it does and how it works. I have search Google but I couldn't find anything that explained all the steps that happens.


Solution

  • When I run the command:

    rails generate scaffold peoples name:string age:integer
    

    The following happens:
    + Rails connects to the database (defined in databases.yml) and creates a new table called peoples
    + In that table it creates two columns named name and age
    + Now it creates the web page that allows you to interface with the table
    Scaffolding gives you a quick start on your Ruby on Rails projects.