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