2527f07365
Add a SelfAssignmentsController to resolve the current user at request time, avoiding the use of an incorrect user id baked into a cached URL. ref: #2211 originally added the "M" hotkey ref: https://app.fizzy.do/5986089/cards/3722
18 lines
472 B
Ruby
18 lines
472 B
Ruby
class Cards::SelfAssignmentsController < ApplicationController
|
|
include CardScoped
|
|
|
|
def create
|
|
if @card.toggle_assignment(Current.user)
|
|
respond_to do |format|
|
|
format.turbo_stream { render "cards/assignments/create" }
|
|
format.json { head :no_content }
|
|
end
|
|
else
|
|
respond_to do |format|
|
|
format.turbo_stream { render "cards/assignments/create" }
|
|
format.json { head :unprocessable_entity }
|
|
end
|
|
end
|
|
end
|
|
end
|