Homework 2: A Mostly Static Website

Assignment

  • Create a Ruby on Rails site/app that has at least 3 static pages (i.e. views)  and the standard Ruby on Rails directories and pages.  This should build on the work you did for Homework 1 and is part of your progress toward developing your individual project
  • The site should use a CSS stylesheet to give the site a consistent look and feel, but you must change the default color scheme in the CSS sheet.  Explore the HTML and CSS practice page if you want help with how to work with HTML and CSS pages.
  • Each page on your website should have some sort of navigation bar (top, or on either side) that links the pages together.  
  • You will need to define controllers, actions, and routes so that there is a home page and links to the other two pages
  • You need to add a little embedded Ruby to make your pages slightly dynamic (to use Hartl’s term).  In section 3.4, he shows how to make the titles of each page reflect which page the user is on. You can follow these instructions or come up with something else that involves some code that is executed and changes the page’s content as the page is displayed.  
  • You should include the testing scripts (Minitest or Rspec) that make sure the proper page loads when a link is clicked, at least.  See if you can think of other tests that you might want to do at this point.  Examples are in 3.3 and 3.4 of Hartl.  You do NOT need to use Guard (Hartl 3.6).  I would rather that you run your test suite using the “rails test” command intentionally.  
  • You need to make a new commit in Git and GitHub.  Please include in the commit message “HW2” so that it is more easily identifiable.
  • You will need to push your current site to GitHub and Heroku for grading.

What to Hand In

You should upload a file containing:

  • A link to your GitHub repo for this assignment
  • A link to the Heroku deployment for this assignment — make sure that it is not your dashboard!  It needs to be the link to the app.  

Yes, if they are the same as for Homework 1, just resubmit the same file.  It makes it much easier for me to grade these and have PioneerWeb record the grades if you upload a file for each assignment.  

Resources and Recommended Reading

Scoring Rubric (10 Points)

  1. 3+ static pages/views visible in Github or Heroku
  2. These pages link to a CSS style sheet with is also visible in GitHub.  This CSS page must have some differences from the one given in Hartl, such as different colors
  3. There is a consistent navigation bar on all of the pages
  4. The root page defined in the router.rb file
  5. There are some slight dynamic features such as page titles changing (with yield and provide)
  6. There are automated testing scripts that test the dynamic features
  7. The repo has been updated on GitHub
  8. The site has been updated and is functional on Heroku (or other hosting site)
  9. Gemfile reflects that there is a production group that includes the ‘pg’ gem
  10. Gemfile reflects that there is a dev and test group that includes sqlite3