Anemic params method
Wont ever get reused here since there is no update
This commit is contained in:
@@ -10,7 +10,7 @@ class Cards::Comments::ReactionsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
reaction = @comment.reactions.create!(reaction_params)
|
||||
reaction = @comment.reactions.create!(params.expect(reaction: :content))
|
||||
|
||||
broadcast_create(reaction)
|
||||
redirect_to card_comment_reactions_path(@card, @comment)
|
||||
@@ -28,10 +28,6 @@ class Cards::Comments::ReactionsController < ApplicationController
|
||||
@comment = @card.comments.find(params[:comment_id])
|
||||
end
|
||||
|
||||
def reaction_params
|
||||
params.expect(reaction: :content)
|
||||
end
|
||||
|
||||
def broadcast_create(reaction)
|
||||
reaction.broadcast_append_to @card, target: [ @comment, :reactions ], partial: "cards/comments/reactions/reaction"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user