Created
July 11, 2014 13:50
-
-
Save wazery/144a4654aef15d1e9f41 to your computer and use it in GitHub Desktop.
Rating
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Rating in Rails | |
###**Introduction** | |
In this tutorial we will explore how to add rating functionality into your Rails application. We will go through some of the popular Ruby Gems that provide rating functionality, also we will show how to implement rating from scratch without Gems. We will use the same application used in the **"Braintree series By Karim El Hussieny"**, in which the basic application creation process is explained in detail, you can refer to it to learn how Karim scaffolded and styled the basic application. Here is the fork repository that we will build on our application [MovieStore](https://github.com/wazery/moviestore). | |
###**What we're going to achieve** | |
As you can see in the repository, it is an online store for movies, we need to add rating functionality to each movie. Each user would give his rating to the available movies. Then each movie will have a score calculated based on users rating, much like what IMDB did. | |
####**Main Features** (to be changed) | |
- **Rating movies:** Rating the available store movies. *(Login required)* | |
- **Unlogged users rating:** Users can rate movie without login to the movie store, but apparently their rating wouldn't appear in any profile, instead it would be used to only calculate overall movie score, after rating anonymous users would be promoted with a login modal to save their rating to their profiles. | |
- **Show user rating:** Each user can visit his/her dashboard and see the movies (s)he rated, (s)he can change the rating at anytime. | |
- **Movie overall score:** Each movie would have a score based on the store users rating. Every movie should have the number of users gave it rates. | |
- **Ability to share user rating** After rating a movie a modal will pop-up to give users the ability to share their ratings to social networks. | |
- **Canceling rating:** User can cancel the rating (s)he give to any movie at any time. | |
- **Movie Recommendations:** User can view some other recommended movies by the store itself based on his/her rating. | |
####**Skills needed** | |
- Good experience to work with Ruby on Rails. | |
- Basic knowledge of HTML/CSS3. | |
- Understanding the concept of responsive CSS frameworks. | |
####**Tools** | |
- **Ruby** `(2.1.0)` - Programming language | |
- **Rails** `(4.1.1)` - Back-end framework | |
- **Foundation 5** - Front-end CSS framework | |
- **Letsrate** - Ruby gem | |
- **Devise** - User authentication | |
###**What we will cover** | |
1. Letsrate available features and how to use it | |
2. Another gem available featues and how to use it | |
3. Building the rating mechanism ourselves | |
--- | |
###**Step 1:** Adding **letsrate** gem | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment