Sha256: 4ba44901fa8788d68c5ab3574a5ff46dedd3d3a6610a8b01d50aee005cd0c4c1

Contents?: true

Size: 373 Bytes

Versions: 6

Compression:

Stored size: 373 Bytes

Contents

module Gaku
  class StatesController < CoreController

    respond_to :js, :json

    def index
      if params[:country_id]
        @country = Country.find(params[:country_id])
        @states = State.where(country_iso: @country.iso)
                       .order('name asc')
      else
        @states = State.all
      end

      respond_with @states
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gaku-0.2.2 admin/app/controllers/gaku/states_controller.rb
gaku_admin-0.2.2 app/controllers/gaku/states_controller.rb
gaku-0.2.1 admin/app/controllers/gaku/states_controller.rb
gaku_admin-0.2.1 app/controllers/gaku/states_controller.rb
gaku-0.2.0 admin/app/controllers/gaku/states_controller.rb
gaku_admin-0.2.0 app/controllers/gaku/states_controller.rb