Sha256: da31eb13d0c4ba99eef54d22673d3a680d0de46e37e71eba69c583d96e753ae5

Contents?: true

Size: 651 Bytes

Versions: 5

Compression:

Stored size: 651 Bytes

Contents

class Admin::StatesController < Admin::BaseController
  resource_controller

  belongs_to :country
  before_filter :load_data

  index.response do |wants|
    wants.html
    wants.js do
      render :partial => 'state_list.html.erb'
    end
  end

  new_action.response do |wants|
    wants.html {render :layout => !request.xhr?}
  end

  create.wants.html { redirect_to admin_country_states_url(@country) }
  update.wants.html { redirect_to admin_country_states_url(@country) }

  private

    def collection
      @collection ||= end_of_association_chain.order('name')
    end

    def load_data
      @countries = Country.order('name')
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_core-0.50.4 app/controllers/admin/states_controller.rb
spree_core-0.50.3 app/controllers/admin/states_controller.rb
spree_core-0.50.2 app/controllers/admin/states_controller.rb
spree_core-0.50.1 app/controllers/admin/states_controller.rb
spree_core-0.50.0 app/controllers/admin/states_controller.rb