Files
fizzy/app/controllers/boards/columns_controller.rb
T
2025-12-03 23:24:25 -08:00

33 lines
709 B
Ruby

class Boards::ColumnsController < ApplicationController
include BoardScoped
before_action :ensure_permission_to_admin_board, only: %i[ create update destroy ]
before_action :set_column, only: %i[ show update destroy ]
def show
set_page_and_extract_portion_from @column.cards.active.latest.with_golden_first.preloaded
fresh_when etag: @page.records
end
def create
@column = @board.columns.create!(column_params)
end
def update
@column.update!(column_params)
end
def destroy
@column.destroy
end
private
def set_column
@column = @board.columns.find(params[:id])
end
def column_params
params.expect(column: [ :name, :color ])
end
end