Class: Admin::AdditionalCalculatorRatesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::AdditionalCalculatorRatesController
- Defined in:
- app/controllers/admin/additional_calculator_rates_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
12 13 14 |
# File 'app/controllers/admin/additional_calculator_rates_controller.rb', line 12 def edit @rates_by_type = get_rates_by_type(@calculator) end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/admin/additional_calculator_rates_controller.rb', line 8 def index @calculators = Calculator.where(:is_additional_calculator => true).order('created_at DESC') end |
#update ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/admin/additional_calculator_rates_controller.rb', line 16 def update if @calculator.update_attributes(params[:additional_calculator_weight_and_quantity]) # TODO: this must be changed!!! flash[:notice] = t('resource_controller.successfully_updated') redirect_to edit_admin_additional_calculator_rate_url(@calculator) else @rates_by_type = get_rates_by_type(@calculator, false) # set @rates_by_type before rendering the view render :action => 'edit' end end |