Sha256: 798877fb1791f6a2c7e07a48a8a02f4e1796c2ff600b6210ca59695fecb4a704

Contents?: true

Size: 921 Bytes

Versions: 9

Compression:

Stored size: 921 Bytes

Contents

class Admin::ZonesController < Admin::BaseController
  resource_controller  
  
  before_filter :load_data

  create.response do |wants|
    wants.html { redirect_to collection_url }
  end

  update.response do |wants|
    wants.html { redirect_to collection_url }
  end
  
  destroy.success.wants.js { render_js_for_destroy }
  
  private
  def build_object
    @object ||= end_of_association_chain.send parent? ? :build : :new, object_params
    @object.zone_members.build() if @object.zone_members.empty?  
    @object
  end

  def collection
    @search = end_of_association_chain.searchlogic(params[:search])
    @search.order ||= "ascend_by_name"
    @collection_count = @search.count
    @collection = @search.paginate(:per_page => Spree::Config[:orders_per_page], :page => params[:page])
  end  

  def load_data
    @countries = Country.all.sort
    @states = State.all.sort
    @zones = Zone.all.sort
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spree-0.11.4 app/controllers/admin/zones_controller.rb
spree-0.11.3 app/controllers/admin/zones_controller.rb
spree-0.11.2 app/controllers/admin/zones_controller.rb
spree-0.11.1 app/controllers/admin/zones_controller.rb
spree-0.11.0 app/controllers/admin/zones_controller.rb
spree-0.10.2 app/controllers/admin/zones_controller.rb
spree-0.10.1 app/controllers/admin/zones_controller.rb
spree-0.10.0 app/controllers/admin/zones_controller.rb
spree-0.10.0.beta app/controllers/admin/zones_controller.rb