Files
fizzy/app/controllers/collections/columns_controller.rb
T
David Heinemeier Hansson 0a9e1620a0 No longer needed
2025-11-03 13:46:22 +01:00

32 lines
634 B
Ruby

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