Sha256: f2f452bc9ccf8df5a4a49c30340f1cba7e74095c145be7ab0f377b7c23319f92
Contents?: true
Size: 655 Bytes
Versions: 5
Compression:
Stored size: 655 Bytes
Contents
class Admin::ShippingMethodsController < Admin::BaseController resource_controller before_filter :load_data update.wants.html { redirect_to edit_object_url } create.wants.html { redirect_to edit_object_url } destroy.success.wants.js { render_js_for_destroy } private def build_object @object ||= end_of_association_chain.send((parent? ? :build : :new), object_params) @object.calculator = params[:shipping_method][:calculator_type].constantize.new if params[:shipping_method] @object end def load_data @available_zones = Zone.order(:name) @calculators = ShippingMethod.calculators.sort_by(&:description) end end
Version data entries
5 entries across 5 versions & 1 rubygems