Class: Plugins::Ecommerce::Admin::ShippingMethodsController
- Inherits:
-
Plugins::Ecommerce::AdminController
- Object
- Plugins::Ecommerce::AdminController
- Plugins::Ecommerce::Admin::ShippingMethodsController
- Defined in:
- app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 23 def create @shipping_method = current_site.shipping_methods.new(shipping_permit_data) if @shipping_method.save @shipping_method.('_default',params[:options]) flash[:notice] = t('camaleon_cms.admin.post_type.message.created') redirect_to action: :index else render 'form' end end |
#edit ⇒ Object
18 19 20 21 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 18 def edit ("#{t('camaleon_cms.admin.button.edit')}") render 'form' end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 4 def index @shipping_methods = current_site.shipping_methods.paginate(:page => params[:page], :per_page => current_site.admin_per_page) end |
#new ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 8 def new @shipping_method = current_site.shipping_methods.new ("#{t('plugins.ecommerce.new')}") render 'form' end |
#show ⇒ Object
14 15 16 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 14 def show ("#{t('plugins.ecommerce.table.details')}") end |
#update ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb', line 34 def update if @shipping_method.update(shipping_permit_data) @shipping_method.('_default',params[:options]) flash[:notice] = t('camaleon_cms.admin.post_type.message.updated') redirect_to action: :index else render 'form' end end |