Sha256: 1375b9ffd03b55626c5317a32c2cb65577b566678b8052ca7d955b2ff2288fc5

Contents?: true

Size: 917 Bytes

Versions: 3

Compression:

Stored size: 917 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_sender,
          :email_activate_flag
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
comable_backend-0.4.0 app/controllers/comable/admin/store_controller.rb
comable_backend-0.3.4 app/controllers/comable/admin/store_controller.rb
comable_backend-0.3.3 app/controllers/comable/admin/store_controller.rb