To Projects

IT 231 -- Project 4

Random Quote and Image

  1. Find at five least quotes for which you can find images of the persons to which the quote is attributed.
     
  2. Create a Rails project named Proj4Smith (replace Smith by your last name).
     
  3. Create a controller named ShowQuote with a view named display.
     
  4. Create a model named QuoteInfo that has fields quote_number (integer), quote (string), person (string), birth_date (date), death_date (date), is_living (boolean), image_name (string).
     
    You may find this controller code useful:
    if @c.is_living == true
      @years_lived = 
        "Years lived: #{@c.birth_date.day}/#{@c.birth_date.mon}/#{@c.birth_date.year}" +
        " to #{@c.death_date.day}/#{@c.death_date.mon}/#{@c.death_date.year}." 
    else
      @years_lived =
        "Years lived: #{@c.birth_date.day}/#{@c.birth_date.mon}/#{@c.birth_date.year}" +
        " to Present."
    end
    
  5. Place ActiveRecord commands into the seed.rb file that will be used to populate the database table QuoteInfo.
     
  6. Pick a random number with the Ruby rand method. Then select a random record from the database and display that information on the display view.
     
  7. Place all images that are associated with quotes in the app/assets/images folder.
     
  8. Include a CSS external style sheet to set the colors and fonts on the page.
     
  9. Place a stylesheet in the app/assets/stylesheets folder that sets the colors and fonts.
     
  10. Include a background image for the body or on a div tag of your view. Here is some sample CSS code to use:
    Also include a background color in case the body is larger than the background image. Put the background image in the assets/images folder.
     
  11. Images should be 25K or less. You may need to make your background image larger than 25K, but you can also shrink, then enlarge an image to reduce its filesize. The price you pay is decreased resolution.
     
  12. Make sure that the indentation is correct in the controller. Up to 10 points will be deducted for incorrect indentation.
     
  13. Include a title and a h1 or h2 heading on your page, for example
     

    (In my opinion, every decent webpage has a header that tells the user what is on the page.)
     
  14. See Examples 22 and 22.5 (Flintstones and Flintstones2 Examples) on the Examples Page to help you with the source code.
     
  • Grading: Functionality: 40%; Content: 15%; Styles and Layout: 20%; Controller Indentation: 10%; Images should be 25K or less. 10%; Submitted Correctly: 10%.