To Examples

LikesSite Example

Directions

  1. Create a new Rails project named LikesSite.
  2. Generate a Rails scaffold named Like with these fields.
    Field Datatype
    is_like boolean
    is_unlike boolean
    comment string
  3. Modify the Like index view to use this source code: index.html.erb.
  4. Add these CSS styles to likes.scss:
    ul.heart { list-style-image: url(heart.png) }
    ul.thumbs-down { list-style-image: url(thumbs-down.png) }
    
  5. Download these heart and thumbs-down images and place them in LikesSite/app/assets/images
  6. View the show pages with this URLs:
    http://localhost:3000/likes