Class: Plugins::Ecommerce::Admin::PaymentMethodsController
- Inherits:
-
Plugins::Ecommerce::AdminController
- Object
- Plugins::Ecommerce::AdminController
- Plugins::Ecommerce::Admin::PaymentMethodsController
- Defined in:
- app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 25 def create @payment_method = current_site.payment_methods.new(payment_permit_data) if @payment_method.save @payment_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
20 21 22 23 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 20 def edit ("#{t('camaleon_cms.admin.button.edit')}") render 'form' end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 4 def index @payment_methods = current_site.payment_methods.paginate(:page => params[:page], :per_page => current_site.admin_per_page) end |
#new ⇒ Object
8 9 10 11 12 13 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 8 def new @payment_method = current_site.payment_methods.new @payment_method.status = 1 ("#{t('plugins.ecommerce.new')}") render 'form' end |
#show ⇒ Object
15 16 17 18 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 15 def show ("#{t('plugins.ecommerce.table.details')}") @payment_method = @payment_method.decorate end |
#update ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb', line 36 def update if @payment_method.update(payment_permit_data) @payment_method.('_default',params[:options]) flash[:notice] = t('camaleon_cms.admin.post_type.message.updated') redirect_to action: :index else render 'form' end end |