Sha256: 87b655b1b8030505ec063e128bc0afd2a7798c9164c198b3d38fadcdc9d210a7

Contents?: true

Size: 860 Bytes

Versions: 6

Compression:

Stored size: 860 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.search(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

6 entries across 6 versions & 2 rubygems

Version Path
spree-enriquez-0.9.4 app/controllers/admin/zones_controller.rb
spree-0.9.4 app/controllers/admin/zones_controller.rb
spree-0.9.3 app/controllers/admin/zones_controller.rb
spree-0.9.2 app/controllers/admin/zones_controller.rb
spree-0.9.1 app/controllers/admin/zones_controller.rb
spree-0.9.0 app/controllers/admin/zones_controller.rb