Class: Shoppe::TaxRatesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Shoppe::TaxRatesController
- Defined in:
- app/controllers/shoppe/tax_rates_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 15 def create @tax_rate = Shoppe::TaxRate.new(safe_params) if @tax_rate.save redirect_to :tax_rates, :flash => {:notice => "Tax rate has been created successfully"} else render :action => "form" end end |
#destroy ⇒ Object
36 37 38 39 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 36 def destroy @tax_rate.destroy redirect_to :tax_rates, :flash => {:notice => "Tax rate has been removed successfully"} end |
#edit ⇒ Object
24 25 26 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 24 def edit render :action => "form" end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 6 def index @tax_rates = Shoppe::TaxRate.ordered.all end |
#new ⇒ Object
10 11 12 13 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 10 def new @tax_rate = Shoppe::TaxRate.new render :action => "form" end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/shoppe/tax_rates_controller.rb', line 28 def update if @tax_rate.update(safe_params) redirect_to [:edit, @tax_rate], :flash => {:notice => "Tax rate has been updated successfully"} else render :action => "form" end end |