Sha256: 73701a3f23ee4dc13fbefbf97d34027c8c9b0ef4c9b000a9885a61d415c2c68f

Contents?: true

Size: 878 Bytes

Versions: 8

Compression:

Stored size: 878 Bytes

Contents

require_dependency 'comable/admin/application_controller'

module Comable
  module Admin
    class StoreController < Comable::Admin::ApplicationController
      authorize_resource class: Comable::Store.name

      before_filter :find_store, only: [:show, :edit, :update]

      def show
        render :edit
      end

      def edit
      end

      def update
        if @store.update_attributes(store_params)
          redirect_to comable.admin_store_url, notice: Comable.t('successful')
        else
          flash.now[:alert] = Comable.t('failure')
          render :edit
        end
      end

      private

      def find_store
        @store = Comable::Store.instance
      end

      def store_params
        params.require(:store).permit(
          :name,
          :meta_keywords,
          :meta_description,
          :email
        )
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
comable-backend-0.7.1 app/controllers/comable/admin/store_controller.rb
comable-backend-0.7.0 app/controllers/comable/admin/store_controller.rb
comable-backend-0.7.0.beta2 app/controllers/comable/admin/store_controller.rb
comable-backend-0.7.0.beta1 app/controllers/comable/admin/store_controller.rb
comable-backend-0.6.0 app/controllers/comable/admin/store_controller.rb
comable_backend-0.5.0 app/controllers/comable/admin/store_controller.rb
comable_backend-0.4.2 app/controllers/comable/admin/store_controller.rb
comable_backend-0.4.1 app/controllers/comable/admin/store_controller.rb