Sha256: a33e55313cc3109014bae10f9c5b313d78fcfab45cf43ea86189910060276ac9

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

class Admin::BlockKindsController < Admin::ForestController
  before_action :set_block_kind, only: [:edit, :update]

  def index
    @block_kinds = apply_scopes(BlockKind).by_id.page params[:page]
  end

  def edit
    authorize @block_kind
  end

  def update
    authorize @block_kind

    if @block_kind.update(block_kind_params)
      redirect_to edit_admin_block_kind_path(@block_kind), notice: 'BlockKind was successfully updated.'
    else
      render :edit
    end
  end

  private

    def block_kind_params
      params.require(:block_kind).permit(:description, :category)
    end

    def set_block_kind
      @block_kind = BlockKind.find(params[:id])
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forest_cms-0.98.1 app/controllers/admin/block_kinds_controller.rb