|
|||||||||||||||||||||||||||
Photo Site Exercise using Rails
In this project you will use Rails to create the beginnings of a photo-sharing Web site. For this project, the Web site will display pre-entered information in the database. In future projects you will add additional features, such as the ability to add new photos and to tag photos with the names of users. SetupCreate a Rails application for this project by invoking the following command: RubyMine IDE: File->New Project -> Ruby Project, name it PhotoSite This will create a directory project4 that contains a skeleton for the project. Your solutions for the problems below should be implemented in this project. Follow the instructions described under Additional Setup for Project #3 to modify the default Rails configuration. Item 1: Use Migrations to Create the Database
Item 2: Create the ApplicationCreate controllers and views that implement two URLs.
The first URL is /users/index.When this URL is referenced your application must return a Web page that displays a list of all users in the database. The user names must be links: clicking on a user name displays the photos for that user, as described below.
The second URL is /photos/index/idThe second URL supported by your application has the form /photos/index/id, where id is the database identifier for a particular user. When this URL is referenced your application must return a web page displaying all of the photos belonging to that user. For each photo you must display the photo itself, the creation time for the photo, and all of the comments for that photo. For each comment you must display the time when the comment was created, the name of the user who created the comment, and the text of the comment. The creator for each __comment should be a link that can be clicked to switch to the photos page for that user.
Note regarding Formatting/Style of out OutputAlthough you don't need to spend a lot of time on the appearance of the pages you generate, they should be neat and understandable. They should have meaningful titles, and the information layout should be clean (e.g., it should be clear which photo each comment applies to). Use the personalized layout you created for the last project. |
|||||||||||||||||||||||||||
© Lynne Grewe |