Files
fizzy/app/controllers/assignments_controller.rb
T
2024-09-18 13:09:06 -04:00

25 lines
584 B
Ruby

class AssignmentsController < ApplicationController
include BubbleScoped, ProjectScoped
before_action :set_assignment, only: :update
def create
@assignment = @bubble.assignments.create!(assignment_params)
redirect_to project_bubble_url(@project, @bubble)
end
def update
@assignment.update!(assignment_params)
redirect_to project_bubble_url(@project, @bubble)
end
private
def assignment_params
params.require(:assignment).permit(:user_id)
end
def set_assignment
@assignment = @bubble.assignments.find(params[:id])
end
end