- 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 automated 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.
- 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
- Codeacademy’s article on the Request-Response Cycle for static pages
- Hartl Ruby on Rails Tutorial Chapter 3 or Diego Flores’ Beginner’s Guide to Making a Portfolio Website with Ruby on Rails (Part 1 and Part 2)
- Hartl Ruby on Rails Tutorial Sections 5.1 and 5.3 (CSS for Rails)
- HTML and CSS practice page
Scoring Rubric (10 Points)
- 3+ static pages/views visible in Github or Heroku
- 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
- There is a consistent navigation bar on all of the pages
- The root page defined in the router.rb file
- There are some slight dynamic features such as page titles changing (with yield and provide)
- There are automated testing scripts that test the dynamic features
- The repo has been updated on GitHub
- The site has been updated and is functional on Heroku (or other hosting site)
- Gemfile reflects that there is a production group that includes the ‘pg’ gem
- Gemfile reflects that there is a dev and test group that includes sqlite3