Class: Decidim::Comments::VotesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Decidim::Comments::VotesController
- Defined in:
- app/controllers/decidim/comments/votes_controller.rb
Overview
Controller that manages the comment votes.
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File '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 |