Rails I
3 credits
Application functions as described and allows all needed data to be managed | 50 |
Navigation is present and works as described | 20 |
Tests are present, complete, and passing | 30 |
Total | 100 pts |
Practice working with and modifying scaffolds
For this lab you will be creating a small partial web application for a pet shelter. The public portion of the site will focus on allowing potential adopters to review a list of animals available at the shelter based on animal type. The backend of the website will allow the owners of the shelter to manage their list of animals, their types, and the users of the administrative backend.
For the public portion of the application there only needs to be two pages. The first, which will be the homepage, should should a list of all of the types of animals the shelter shelters. The list should include dogs, cats, birds, rodents, snakes, and lizards. Each of the animal types should be hyperlinks that when clicked will take the visitor to the second of the public pages which will display all of the animals in the shelter of that type. Clicking "dog" on the homepage would show the visitor a list of all dogs, for example.
For the backend of the application any logged in user should have a full set of pages for listing, viewing, creating, editing, or destroying animal types and animals of each specific type. When the user is creating or editing an animal they should be required to say what type of animal it is and should only have the option of choosing one of the types that are available. In addition to the type each animal should have a name, a weight, a color and a description.
Only users that are present in the user table of the database should be able to login to use the backend of the application. Any user who is logged in should have the ability to list, view, edit, create, or destroy any users in this table, including themselves. Each user only needs a username and password.
The application should include enough links to make all parts of the site visitable without having to type a URL but a visitor should never be shown a link that they are not authorized to visit. As a result any non-logged in user should only be able to visit the pubic pages and the login page.
As always, at least one test needs to be present for each controller action. In addition to those you should add at least one action to each controller confirming that a private page can not be accessed unless logged in.