Class: FavoritesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  create! do |success, failure|
    success.html do
      add_fingerprint_and_user_id(@favorite,true)
      add_able_rep("favorited",@favorite)
      redirect_to :back
    end
    failure.html { redirect_to :back }
  end
end

#destroyObject



13
14
15
16
17
18
19
20
# File 'app/controllers/favorites_controller.rb', line 13

def destroy
  def destroy
    destroy! do |success, failure|
      success.html{redirect_to :back}
      failure.html{redirect_to :back}
    end
  end
end