2022-06-25 22:45:47 +00:00
|
|
|
class BoardsController < ApplicationController
|
|
|
|
before_action :require_login
|
|
|
|
|
|
|
|
def edit
|
|
|
|
@users = User.where(active: true)
|
2023-07-12 18:13:08 +00:00
|
|
|
@users += Array.new(6 - @users.size) { User.new }
|
2022-06-25 22:45:47 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
User.update_board_members(board_params)
|
|
|
|
|
|
|
|
redirect_to edit_board_path
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def board_params
|
|
|
|
params.require('users')
|
|
|
|
end
|
|
|
|
end
|