Files
fizzy/app/controllers/assignments_controller.rb
T
Jason Zimdars 56c7fe4abb Add assignees to a bubble WIP
- Still needs UI to display multiple assignees
- Still needs UI for changing/removing assignees
2024-09-17 17:10:23 -05:00

31 lines
618 B
Ruby

class AssignmentsController < ApplicationController
before_action :set_bubble, only: %i[ create update ]
before_action :set_assignment, only: :update
def create
@assignment = @bubble.assignments.build(assignment_params)
@assignment.save
redirect_to @bubble
end
def update
@assignment.update(assignment_params)
redirect_to @bubble
end
private
def assignment_params
params.require(:assignment).permit(:user_id)
end
def set_assignment
@assignment = @bubble.assignments.find(params[:id])
end
def set_bubble
@bubble = Bubble.find(params[:bubble_id])
end
end