Class: LikesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- LikesController
- Defined in:
- app/controllers/likes_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /activities/1/like.js.
-
#destroy ⇒ Object
DELETE /activities/1/like.js.
Instance Method Details
#create ⇒ Object
POST /activities/1/like.js
5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/likes_controller.rb', line 5 def create @like = Like.build(current_subject, @indirect_id) respond_to do |format| if @like.save format.js else format.js end end end |
#destroy ⇒ Object
DELETE /activities/1/like.js
18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/likes_controller.rb', line 18 def destroy @like = Like.find!(current_subject, @indirect_id) respond_to do |format| if @like.destroy format.js else format.js end end end |