To Examples

Greeter Directions

 

  1. Create a new rails project named Greeter in your file for Rails projects (say c:\it231-rails):
    > rails new Greeter
     
  2. Navigate to the Greeter folder:
    > cd Greeter
     
  3. Create a new rails controller and three new views:
    > rails g controller ShowGreeting greeting response1 response1
     
  4. Replace the file Greeter/app/views/show_greeting/greeting.html.erb with
    greeting.html.erb.
     
  5. Replace the file Greeter/app/views/show_greeting/response1.html.erb with
    response1.html.erb.
     
  6. Replace the file Greeter/app/views/show_greeting/response2.html.erb with
    response2.html.erb.
     
  7. Replace the file Greeter/app/layouts/application.html.erb with
    application.html.erb.
     
  8. Add the file styles.css to the folder Greeter/app/assets/stylesheets with
     
  9. Start the Rails server:
    > rails server
     
  10. In a browser navigate to this URL:
    > http://localhost:3000/show_greeting/greeting