Class: Forge::CountriesController
Instance Method Summary
collapse
#get_menu_items, #load_help, #set_crumbs, #set_title, #uses_ckeditor
#app_init
Instance Method Details
#get_active_countries ⇒ Object
25
26
27
28
29
30
|
# File 'lib/forge/app/controllers/forge/countries_controller.rb', line 25
def get_active_countries
@countries = Country.active.all.map {|country| country.title}
respond_to do |format|
format.js {render :json => @countries}
end
end
|
#get_provinces ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/forge/app/controllers/forge/countries_controller.rb', line 16
def get_provinces
if params[:id]
@provinces = Country.find(params[:id]).province_options_for_select(:add_blank => true)
respond_to do |format|
format.js {render :json => @provinces}
end
end
end
|
#index ⇒ Object
4
5
6
7
|
# File 'lib/forge/app/controllers/forge/countries_controller.rb', line 4
def index
@active_countries = Country.active.all
@countries = Country.alphabetical.all
end
|
#update ⇒ Object
9
10
11
12
13
14
|
# File 'lib/forge/app/controllers/forge/countries_controller.rb', line 9
def update
@country.update_attributes(params[:country])
respond_to do |format|
format.js { render :nothing => true}
end
end
|