31 lines
628 B
Ruby
31 lines
628 B
Ruby
class Collections::ColumnsController < ApplicationController
|
|
include ActionView::RecordIdentifier, CollectionScoped
|
|
|
|
before_action :set_column, only: [ :show, :update, :destroy ]
|
|
|
|
def show
|
|
set_page_and_extract_portion_from @column.cards.active.reverse_chronologically
|
|
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.require(:column).permit(:name)
|
|
end
|
|
end
|