Class: FavoritesController
- Inherits:
-
InheritedResources::Base
- Object
- InheritedResources::Base
- FavoritesController
- Defined in:
- app/controllers/favorites_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |