Class: Spree::Admin::TaxCloudSettingsController
- Inherits:
-
BaseController
- Object
- BaseController
- Spree::Admin::TaxCloudSettingsController
- Defined in:
- lib/controllers/backend/spree/admin/tax_cloud_settings_controller.rb
Instance Method Summary collapse
Instance Method Details
#dismiss_alert ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/controllers/backend/spree/admin/tax_cloud_settings_controller.rb', line 19 def dismiss_alert if request.xhr? && params[:alert_id] dismissed = Spree::Config[:dismissed_spree_alerts] || '' Spree::Config.set dismissed_spree_alerts: dismissed.split(',').push(params[:alert_id]).join(',') filter_dismissed_alerts render nothing: true end end |
#edit ⇒ Object
6 7 8 |
# File 'lib/controllers/backend/spree/admin/tax_cloud_settings_controller.rb', line 6 def edit @preferences_tic = [:taxcloud_default_product_tic, :taxcloud_shipping_tic] end |
#update ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/controllers/backend/spree/admin/tax_cloud_settings_controller.rb', line 10 def update params.each do |name, value| Spree::Config[name] = value if Spree::Config.has_preference? name end flash[:success] = I18n.t('spree.successfully_updated', resource: I18n.t('spree.tax_cloud_settings')) redirect_to edit_admin_tax_cloud_settings_path end |