For this homework, you will create simple, (mostly) static web pages in Rails and practice using the basic version control features of Git.
You will do this homework as a team; however, each member of your team will be responsible for the completion of a particular task.
Rather than starting from scratch, your team is going to start off with a project skeleton. Each team member must clone the skeleton repo, so that each has their own copy to work on.
To get going, do the following:
Fire up your Ubuntu VM and SSH into it, using the commands vagrant up
and vagrant ssh
.
Change directory (using cd
) into the workspace
folder.
Using your host OS’s web browser, find your team’s repo on GitHub via this link: https://github.com/memphis-cs-projects/
Locate the “HTTPS clone URL” on your team’s GitHub-repo page.
Back in VM, run the command git clone MYURL
such that MYURL is your team’s HTTPS clone URL. This command creates a folder that has the same name as your team’s repo and that contains a working copy of the project code and a copy of the repo.
Change directory into this folder. No message from RVM will be displayed, but you can confirm that RVM is using the correct Ruby version and gemset by running the commands rvm list
(should indicate that the Ruby version is 2.5.1
) and rvm gemset list
(should indicate that the gemset is app
).
Install the gems (i.e., library dependencies) that the project needs by running the following commands. These commands install all the libraries (gems) that you’ll need to build and run the project.
gem install bundler
bundle install
You can now test the skeleton by first starting the Rails server with the command rails s –b 0.0.0.0
, and then opening the URL http://localhost:3000/ in a web browser in your host OS. You should see a homepage that looks like this:
If you click the “About” link, you should see an About page that looks like this:
Each team member must create two web pages:
Each of your pages must use each of the following HTML tags at least once (again, some creativity may be required on your part to work all of these in):
h1
– Level-1 headingh2
– Level-2 headingp
– Paragraphul
/li
– Unordered listEach of your pages must use each of the following Rails view helper methods:
link_to
- Hyperlinkimage_tag
- Image embedding (hint: by default, image files are loaded from app/assets/images/
, so you should save your images there)Your form for the second page must use each of the following HTML tags:
form
– Input form containing the following elements:
input
- Text field (type=text
)textarea
- Text areainput
– Radio buttons (type="radio"
)datalist
– Dropdown list (doesn’t do anything other than let you choose an item)button
– Button (doesn’t do anything when pressed)Your two pages must use these tags in noticeably different ways (i.e., the two pages cannot look too similar). Also, all teammates’ pages must look noticeably different from each others’.
When you create your pages, add the appropriate routes, controller actions (i.e., in PagesController
), and ERB views.
You must add hyperlinks (using the link_to
helper) to your pages on the About page. This will enable visitors (and graders) to conveniently navigate to each team member’s pages.
One member of the team should update the About page’s heading to include your team’s name. He/she should also delete the example items/links, so that only your team’s profile-page links remain. (Failure to do this correctly, will result in deductions from all team members.)
Before you can submit, all team members must have merged their code into the master branch and pushed the updates to GitHub. If a team member does not complete their work on time, the rest of the team may submit without that team member’s contribution.
To submit your team’s work, you must “tag” the current commit in the master branch:
git tag -a hw03v1 -m 'Tagged Homework 3 submission (version 1)'
git push origin --tags
To grade your work, I will check out the appropriate tag, and run it on my machine.
Note that if for some reason you need to update your submission, simply repeat the tagging process, but increment the version number (e.g., hw03v2
, hw03v3
, hw03v4
, etc.).
Total marks: 100
The bullets below indicate standard deductions for errors in a submitted item. The deduction list below may not be complete because there may be mistakes that we did not expect. The deduction for an unexpected mistake will be assessed at the time it’s discovered and will reflect how severe the instructor thinks the mistake is.
ul
, but did use li
: -2 per instanceapplication.html.erb
: -5 (taken only once)