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 |
# File 'app/controllers/dorsale/comments_controller.rb', line 10 def create @comment ||= scope.new(comment_params_for_create) @comment, :create? if @comment.save render_comment else render_nothing end end |
#destroy ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/controllers/dorsale/comments_controller.rb', line 36 def destroy @comment, :delete? @comment.destroy render_nothing end |
#edit ⇒ Object
22 23 24 |
# File 'app/controllers/dorsale/comments_controller.rb', line 22 def edit @comment, :update? end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/dorsale/comments_controller.rb', line 26 def update @comment, :update? if @comment.update(comment_params_for_update) render_comment else render_form end end |