Module: Pilgrim::ApplicationHelper

Defined in:
app/helpers/pilgrim/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#select_for_city(form_name, block, params = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/helpers/pilgrim/application_helper.rb', line 43

def select_for_city(form_name, block, params = {})
	city_name = params[:city][:name] rescue "city_id"
	city_html_class = params[:city][:html_class] rescue ""
	city_html_id = block + "_city"

	render :partial => "pilgrim/tags/dropdown", :locals => { 	form_name: form_name, 
																name: city_name, 
																selected_position: 1, 
																kind: "city", 
																block: block, 
																html_class: city_html_class, 
																html_id: city_html_id,
																data: params[:data][:cities]
	}
end

#select_for_country(form_name, block, params = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/pilgrim/application_helper.rb', line 9

def select_for_country(form_name, block, params = {})
	country_name = params[:country][:name] rescue "country_id"
	country_html_class = params[:country][:html_class] + " dropdown_location" rescue "dropdown_location"
	country_html_id = block + "_country"

	render  :partial => "pilgrim/tags/dropdown", 
           :locals => { 	
                           form_name: form_name, 
													name: country_name, 
													selected_position: 1, 
													kind: "country", 
													block: block, 
													html_class: country_html_class, 
													html_id: country_html_id,
													data: params[:data][:countries]
	}
end

#select_for_element_aux(form_name, name, data, selected_position, kind, block, html_class, html_id) ⇒ Object



59
60
61
# File 'app/helpers/pilgrim/application_helper.rb', line 59

def select_for_element_aux(form_name, name, data, selected_position, kind, block, html_class, html_id)
	render :partial => "pilgrim/tags/dropdown_aux", :locals => { form_name: form_name, name: name, data: data, selected_position: selected_position, :kind => kind, :block => block, :html_class => html_class, :html_id => html_id }
end

#select_for_state(form_name, block, params = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/pilgrim/application_helper.rb', line 27

def select_for_state(form_name, block, params = {})
	state_name = params[:state][:name] rescue "state_id"
	state_html_class = params[:state][:html_class] + " dropdown_location" rescue "dropdown_location"
	state_html_id = block + "_state"

	render :partial => "pilgrim/tags/dropdown", :locals => { 	form_name: form_name, 
																name: state_name, 
																selected_position: 1, 
																kind: "state", 
																block: block, 
																html_class: state_html_class, 
																html_id: state_html_id,
																data: params[:data][:states]
	}
end

#select_location_tag(form_name, params = {}) ⇒ Object



4
5
6
7
# File 'app/helpers/pilgrim/application_helper.rb', line 4

def select_location_tag(form_name, params = {})
	block = params[:block].nil? ? "main" : params[:block]
	render :partial => "pilgrim/tags/container", :locals => { form_name: form_name, params: params, block: block }
end