Skip to content
Browse files

mend

readme is changed
  • Loading branch information...
1 parent 69885df commit ea9cd109e71f1edc2b48d85ed7c6af0bbeb7edf4 @muratguzel committed Sep 7, 2012
Showing with 12 additions and 8 deletions.
  1. +11 −7 README.md
  2. +1 −1 lib/letsrate/version.rb
View
18 README.md
@@ -10,7 +10,7 @@ Find it at [github.com/muratguzel/letsrate](github.com/muratguzel/letsrate)
### Install
-You can add the letsrate gem into your Gemfile
+Add the letsrate gem into your Gemfile
gem 'letsrate'
@@ -25,9 +25,7 @@ Example:
Suppose you will have a devise user model which name is User. The generator should be like below
- rails g devise:install
- rails g devise user
- rails g letsrate user # => This is letsrate generator.
+ rails g letsrate user # => user is the model generated by devise
This generator will create Rate and RatingCache models and link to your user model.
@@ -37,10 +35,10 @@ I suppose you have a car model
rails g model car name:string
-You should add the letsrate_rateable function with its dimensions option.
+You should add the letsrate_rateable function with its dimensions option. You can add multiple dimensions.
class Car < ActiveRecord::Base
- letsrate_rateable :dimensions => [:speed, :engine, :price]
+ letsrate_rateable "speed", "engine", "price"
end
Then you need to add a call letsrate_rater in the user model.
@@ -60,10 +58,16 @@ new rating value from authenticated user.
Speed : <%= rating_for @car, "speed" %>
Engine : <%= rating_for @car, "engine" %>
Price : <%= rating_for @car, "price" %>
+
+If you need to change the star number, you should use star option like below.
+
+ Speed : <%= rating_for @car, "speed", :star => 10 %>
+ Speed : <%= rating_for @car, "speed", :star => 7 %>
+ Speed : <%= rating_for @car, "speed" %>
### Important
-By default rating_for tries to call current_user method as the rater instance in the rater_controller.rb file. You can change the current_user method
+By default rating_for tries to call devise current_user method as the rater instance in the rater_controller.rb file. You can change the current_user method
as you will.
#rater_controller.rb
View
2 lib/letsrate/version.rb
@@ -1,3 +1,3 @@
module Letsrate
- VERSION = "1.0.6.alpha"
+ VERSION = "1.0.7"
end

0 comments on commit ea9cd10

Please sign in to comment.
Something went wrong with that request. Please try again.