Class: Dorsale::CommentsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Dorsale::CommentsController
- Defined in:
- app/controllers/dorsale/comments_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/dorsale/comments_controller.rb', line 10 def create @comment ||= scope.new(comment_params_for_create) @comment, :create? if @comment.save notify_attachable!(:create) render_comment else render_nothing end end |
#destroy ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'app/controllers/dorsale/comments_controller.rb', line 38 def destroy @comment, :delete? @comment.destroy! notify_attachable!(:delete) render_nothing end |
#edit ⇒ Object
23 24 25 |
# File 'app/controllers/dorsale/comments_controller.rb', line 23 def edit @comment, :update? end |
#update ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/dorsale/comments_controller.rb', line 27 def update @comment, :update? if @comment.update(comment_params_for_update) notify_attachable!(:update) render_comment else render_form end end |