Generating HTML

1. Create a new Rails  application called Sample

2. Create a new webpage for the sample application called About

3. Edit sample/app/views/about/index.html.erb

4. We will create the following web page

5. Edit sample/app/views/about/index.html.erb

6. Add styling and links using Rails Helpers

Below we use two Rails Helpers

7. Create another web page for help

  • start by creating a controller named about
  • then edit sample/views/help/index.html.erb
  • check http://localhost:3000/help



8. Time to remove duplication, create a layout file  sample/app/views/layout/application.html.erb

check your pages

  • http://localhost:3000/about
  • http://localhost:3000/help

Remove the duplication from these files

  • sample/views/about/index.html.erb
  • sample/views/help/index.html.erb