Sha256: 3fcf5b6a4b1d3777428a4ced14080f8a68796b7bec6a9129adc3d15bb310ff38

Contents?: true

Size: 832 Bytes

Versions: 7

Compression:

Stored size: 832 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
  
  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.new_search(params[:search])
    @search.order_by ||= :name
    @search.per_page = Spree::Config[:orders_per_page]
    @collection, @collection_count = @search.all, @search.count
  end  

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
kdmny-spree-0.0.1 app/controllers/admin/zones_controller.rb
spree-0.8.4 app/controllers/admin/zones_controller.rb
spree-0.8.5 app/controllers/admin/zones_controller.rb
spree-0.8.0 app/controllers/admin/zones_controller.rb
spree-0.8.1 app/controllers/admin/zones_controller.rb
spree-0.8.2 app/controllers/admin/zones_controller.rb
spree-0.8.3 app/controllers/admin/zones_controller.rb