Class: RatingsController

Inherits:
InheritedResources::Base
  • Object
show all
Defined in:
app/controllers/ratings_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/ratings_controller.rb', line 2

def create
  @rating = Rating.new(params[:rating])
  set_polymorphic_vars(@rating,"rateable")
  add_fingerprint_and_user_id(@rating)

  create! do |success, failure|
    success.html do
      Reputation.add("rated",current_user)
      redirect_to :back
    end
    failure.html { redirect_to :back }
  end
end