Sha256: f93ae9f32ae22466a5e1b05705db842e50718c953c2c96d3e4ddac3cfd749783

Contents?: true

Size: 639 Bytes

Versions: 53

Compression:

Stored size: 639 Bytes

Contents

class Muck::HelperController < ApplicationController

  def load_states_for_country
    country_id = params[:id]
    @states = State.find(:all, :select => 'id, name', :conditions => ["country_id = ?", country_id], :order => "name" )
    label, prompt = Country.build_state_prompts(country_id, true)
    @states.insert(0, State.new(:name => prompt)) if @states.length > 0
    # set cookies so we can remember the last value the user selected
    cookies[:prefered_country_id] = country_id
    respond_to do |format| 
      format.json { render :json => {:states => @states, :label => label, :prompt => prompt}.as_json }
    end
  end
  
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
muck-engine-3.5.0 app/controllers/muck/helper_controller.rb
muck-engine-3.4.0 app/controllers/muck/helper_controller.rb
muck-engine-3.3.18 app/controllers/muck/helper_controller.rb
muck-engine-3.3.17 app/controllers/muck/helper_controller.rb
muck-engine-3.3.16 app/controllers/muck/helper_controller.rb
muck-engine-3.3.15 app/controllers/muck/helper_controller.rb
muck-engine-3.3.14 app/controllers/muck/helper_controller.rb
muck-engine-3.3.13 app/controllers/muck/helper_controller.rb
muck-engine-3.3.12 app/controllers/muck/helper_controller.rb
muck-engine-3.3.11 app/controllers/muck/helper_controller.rb
muck-engine-3.3.10 app/controllers/muck/helper_controller.rb
muck-engine-3.3.9 app/controllers/muck/helper_controller.rb
muck-engine-3.3.8 app/controllers/muck/helper_controller.rb
muck-engine-3.3.7 app/controllers/muck/helper_controller.rb
muck-engine-3.3.6 app/controllers/muck/helper_controller.rb
muck-engine-3.3.5 app/controllers/muck/helper_controller.rb
muck-engine-3.3.4 app/controllers/muck/helper_controller.rb
muck-engine-3.3.3 app/controllers/muck/helper_controller.rb
muck-engine-3.3.2 app/controllers/muck/helper_controller.rb
muck-engine-3.3.1 app/controllers/muck/helper_controller.rb