2d96e7c9c6
Prevents race condition causing flickering https://app.fizzy.do/5986089/cards/2906 This will prevent these from udpating live, but we will tackle that as part of live card updates with page refreshes, which I will tackle soon.
26 lines
449 B
Ruby
26 lines
449 B
Ruby
class Cards::Comments::ReactionsController < ApplicationController
|
|
include CardScoped
|
|
|
|
before_action :set_comment
|
|
|
|
def index
|
|
end
|
|
|
|
def new
|
|
end
|
|
|
|
def create
|
|
@reaction = @comment.reactions.create!(params.expect(reaction: :content))
|
|
end
|
|
|
|
def destroy
|
|
@reaction = @comment.reactions.find(params[:id])
|
|
@reaction.destroy
|
|
end
|
|
|
|
private
|
|
def set_comment
|
|
@comment = @card.comments.find(params[:comment_id])
|
|
end
|
|
end
|