Sha256: a81b6613d3431eb1cb48b07df314a1c342f0e5dadfab33de22331501d4263c94

Contents?: true

Size: 1.29 KB

Versions: 10

Compression:

Stored size: 1.29 KB

Contents

module Gaku
  class Admin::CommuteMethodTypesController < Admin::BaseController

    #load_and_authorize_resource class: CommuteMethodType

    respond_to :js,   only: %i( new create edit update destroy )
    respond_to :html, only: :index

    before_action :set_commute_method_type, only: %i( edit update destroy )

    def index
      @commute_method_types = CommuteMethodType.all
      @count = CommuteMethodType.count
      respond_with @commute_method_types
    end

    def new
      @commute_method_type = CommuteMethodType.new
      respond_with @commute_method_type
    end

    def create
      @commute_method_type = CommuteMethodType.new(commute_method_type_params)
      @commute_method_type.save
      @count = CommuteMethodType.count
      respond_with @commute_method_type
    end

    def edit
    end

    def update
      @commute_method_type.update(commute_method_type_params)
      respond_with @commute_method_type
    end

    def destroy
      @commute_method_type.destroy
      @count = CommuteMethodType.count
      respond_with @commute_method_type
    end

    private

    def set_commute_method_type
      @commute_method_type = CommuteMethodType.find(params[:id])
    end

    def commute_method_type_params
      params.require(:commute_method_type).permit(:name)
    end

  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
gaku-0.1.1 admin/app/controllers/gaku/admin/commute_method_types_controller.rb
gaku_admin-0.1.1 app/controllers/gaku/admin/commute_method_types_controller.rb
gaku-0.1.0 admin/app/controllers/gaku/admin/commute_method_types_controller.rb
gaku_admin-0.1.0 app/controllers/gaku/admin/commute_method_types_controller.rb
gaku_core-0.0.3 app/controllers/gaku/admin/commute_method_types_controller.rb
gaku-0.0.3 core/app/controllers/gaku/admin/commute_method_types_controller.rb
gaku-0.0.2 core/app/controllers/gaku/admin/commute_method_types_controller.rb
gaku_core-0.0.2 app/controllers/gaku/admin/commute_method_types_controller.rb
gaku-0.0.1 core/app/controllers/gaku/admin/commute_method_types_controller.rb
gaku_core-0.0.1 app/controllers/gaku/admin/commute_method_types_controller.rb