Class: Decidim::Comments::VotesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- ApplicationController
- Decidim::Comments::VotesController
- Defined in:
- decidim-comments/app/controllers/decidim/comments/votes_controller.rb
Overview
Controller that manages the comment votes.
Constant Summary
Constants included from RedesignLayout
RedesignLayout::FALLBACK_LAYOUT
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'decidim-comments/app/controllers/decidim/comments/votes_controller.rb', line 13 def create raise ActionController::RoutingError, "Not Found" unless comment :vote, :comment, comment: comment Decidim::Comments::VoteComment.call(comment, current_user, weight: params[:weight].to_i) do on(:ok) do respond_to do |format| format.js { render :create } end end on(:invalid) do respond_to do |format| format.js { render :error } end end end end |