21 lines
354 B
Ruby
21 lines
354 B
Ruby
|
class BoardsController < ApplicationController
|
||
|
before_action :require_login
|
||
|
|
||
|
def edit
|
||
|
@users = User.where(active: true)
|
||
|
@users += Array.new(5 - @users.size) { User.new }
|
||
|
end
|
||
|
|
||
|
def update
|
||
|
User.update_board_members(board_params)
|
||
|
|
||
|
redirect_to edit_board_path
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def board_params
|
||
|
params.require('users')
|
||
|
end
|
||
|
end
|