Class: Spina::Shop::Admin::Settings::TaxGroupsController
- Inherits:
-
ShopController
- Object
- Admin::AdminController
- AdminController
- ShopController
- Spina::Shop::Admin::Settings::TaxGroupsController
- Defined in:
- app/controllers/spina/shop/admin/settings/tax_groups_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/spina/shop/admin/settings/tax_groups_controller.rb', line 12 def create @tax_group = TaxGroup.new(tax_group_params) unless @tax_group.save flash[:alert] = "Failed to save" end redirect_to spina.shop_admin_settings_tax_groups_path end |
#edit ⇒ Object
24 25 26 27 |
# File 'app/controllers/spina/shop/admin/settings/tax_groups_controller.rb', line 24 def edit @tax_group = TaxGroup.find(params[:id]) @tax_group.name end |
#index ⇒ Object
20 21 22 |
# File 'app/controllers/spina/shop/admin/settings/tax_groups_controller.rb', line 20 def index @tax_groups = TaxGroup.all end |
#new ⇒ Object
7 8 9 10 |
# File 'app/controllers/spina/shop/admin/settings/tax_groups_controller.rb', line 7 def new @tax_group = TaxGroup.new @tax_group.tax_rates.build end |
#update ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'app/controllers/spina/shop/admin/settings/tax_groups_controller.rb', line 29 def update @tax_group = TaxGroup.find(params[:id]) if @tax_group.update_attributes(tax_group_params) redirect_to spina.shop_admin_settings_tax_groups_path else render :edit end end |