- Be sure to avoid installing the Ruby documentation in order to save space on AWS Cloud 9. If you create a new environment for your second app, you have to be very careful to follow Hartl’s instructions in Chapter 1 in order to save space and manage the AWS Cloud 9 IDE.
- Make sure that your new app’s config/environments/development.rb file has been updated to include the line
# Allow connections to local server. config.hosts.clear
See Hartl section 1.2.2 for more details.
- 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
- 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