To Examples
Library Directions
- Create a new rails project named Library in your file for
Rails projects (say c:\it231-rails):
> rails new Library
- Navigate to the Library folder:
> cd Library
- Create a new rails controller and three new views:
> rails g controller Info welcome policies staff
- Replace the file Library/app/views/info/welcome.html.erb with
welcome.html.erb.
- Replace the file Library/app/views/info/policies.html.erb with
policies.html.erb.
- Replace the file Library/app/views/info/staff.html.erb with
staff.html.erb.
- Replace the file Library/app/views/layouts/application.html.erb with
application.html.erb.
- Add the file
library.css to the folder
Library/app/assets/stylesheets.
- Replace the file Library/app/controllers/info_controller.rb with
info_controller.rb.
- Copy these images into the folder Library/app/assets/images:
frieda.jpg
lotus.jpg
- Start the Rails server:
> rails s
- In a browser navigate to this URL:
> http://localhost:3000/info/welcome