state_select_plugin 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +46 -0
- data/doc/classes/ActionView.html +107 -0
- data/doc/classes/ActionView/Helpers.html +109 -0
- data/doc/classes/ActionView/Helpers/FormBuilder.html +146 -0
- data/doc/classes/ActionView/Helpers/FormBuilder.src/M000003.html +18 -0
- data/doc/classes/ActionView/Helpers/FormOptionsHelper.html +229 -0
- data/doc/classes/ActionView/Helpers/FormOptionsHelper.src/M000001.html +18 -0
- data/doc/classes/ActionView/Helpers/FormOptionsHelper.src/M000002.html +22 -0
- data/doc/classes/ActionView/Helpers/InstanceTag.html +150 -0
- data/doc/classes/ActionView/Helpers/InstanceTag.src/M000004.html +21 -0
- data/doc/created.rid +1 -0
- data/doc/dot/f_0.dot +14 -0
- data/doc/files/init_rb.html +114 -0
- data/doc/files/install_rb.html +107 -0
- data/doc/files/lib/state_select_rb.html +101 -0
- data/doc/files/test/state_select_test_rb.html +119 -0
- data/doc/fr_class_index.html +31 -0
- data/doc/fr_file_index.html +30 -0
- data/doc/fr_method_index.html +30 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/init.rb +2 -0
- data/install.rb +1 -0
- data/lib/state_select.rb +163 -0
- data/lib/state_select_plugin.rb +163 -0
- data/state_select.gemspec +31 -0
- data/test/state_select_test.rb +8 -0
- metadata +100 -0
@@ -0,0 +1,229 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: ActionView::Helpers::FormOptionsHelper</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">ActionView::Helpers::FormOptionsHelper</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/state_select_rb.html">
|
59
|
+
lib/state_select.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000002">state_options_for_select</a>
|
84
|
+
<a href="#M000001">state_select</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
<div id="constants-list">
|
97
|
+
<h3 class="section-bar">Constants</h3>
|
98
|
+
|
99
|
+
<div class="name-list">
|
100
|
+
<table summary="Constants">
|
101
|
+
<tr class="top-aligned-row context-row">
|
102
|
+
<td class="context-item-name">US_STATES</td>
|
103
|
+
<td>=</td>
|
104
|
+
<td class="context-item-value">["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "Washington D.C.", "West Virginia", "Wisconsin", "Wyoming"] unless const_defined?("US_STATES")</td>
|
105
|
+
</tr>
|
106
|
+
<tr class="top-aligned-row context-row">
|
107
|
+
<td class="context-item-name">INDIA_STATES</td>
|
108
|
+
<td>=</td>
|
109
|
+
<td class="context-item-value">["Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chhattisgarh", "New Delhi", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jammu and Kashmir", "Jharkhand", "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mizoram", "Nagaland", "Orissa""Punjab", "Rajasthan", "Sikkim", "Tamil Nadu", "Tripura", "Uttaranchal", "Uttar Pradesh", "West Bengal"] unless const_defined?("INDIA_STATES")</td>
|
110
|
+
</tr>
|
111
|
+
<tr class="top-aligned-row context-row">
|
112
|
+
<td class="context-item-name">CANADA_STATES</td>
|
113
|
+
<td>=</td>
|
114
|
+
<td class="context-item-value">["Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland", "Northwest Territories", "Nova Scotia", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon"] unless const_defined?("CANADA_STATES")</td>
|
115
|
+
</tr>
|
116
|
+
<tr class="top-aligned-row context-row">
|
117
|
+
<td class="context-item-name">AUSTRALIA_STATES</td>
|
118
|
+
<td>=</td>
|
119
|
+
<td class="context-item-value">["Australian Capital Territory", "New South Wales", "Northern Territory", "Queensland", "South Australia", "Tasmania", "Victoria", "Western Australia"] unless const_defined?("AUSTRALIA_STATES")</td>
|
120
|
+
</tr>
|
121
|
+
<tr class="top-aligned-row context-row">
|
122
|
+
<td class="context-item-name">SPAIN_STATES</td>
|
123
|
+
<td>=</td>
|
124
|
+
<td class="context-item-value">[ "Alava", "Albacete", "Alicante", "Almeria", "Asturias", "Avila", "Badajoz", "Barcelona", "Burgos", "Caceres", "Cadiz", "Cantrabria", "Castellon", "Ceuta", "Ciudad Real", "Cordoba", "Cuenca", "Girona", "Granada", "Guadalajara", "Guipuzcoa", "Huelva", "Huesca", "Islas Baleares", "Jaen", "La Coruna","Leon", "Lleida", "Lugo", "Madrid", "Malaga", "Melilla", "Murcia", "Navarra", "Ourense", "Palencia", "Palmas, Las", "Pontevedra", "Rioja, La", "Salamanda", "Santa Cruz de Tenerife", "Segovia", "Sevila", "Soria", "Tarragona", "Teruel", "Toledo", "Valencia", "Valladolid", "Vizcaya", "Zamora", "Zaragoza"] unless const_defined?("SPAIN_STATES")</td>
|
125
|
+
</tr>
|
126
|
+
<tr class="top-aligned-row context-row">
|
127
|
+
<td class="context-item-name">UGANDA_STATES</td>
|
128
|
+
<td>=</td>
|
129
|
+
<td class="context-item-value">["Abim", "Adjumani", "Amolatar", "Amuria", "Apac", "Arua", "Budaka", "Bugiri", "Bukwa", "Bulisa", "Bundibugyo", "Bushenyi", "Busia", "Busiki", "Butaleja", "Dokolo", "Gulu", "Hoima", "Ibanda", "Iganga", "Jinja", "Kaabong", "Kabale", "Kabarole", "Kaberamaido", "Kabingo", "Kalangala", "Kaliro", "Kampala", "Kamuli", "Kamwenge", "Kanungu", "Kapchorwa", "Kasese", "Katakwi", "Kayunga", "Kibale", "Kiboga", "Kilak", "Kiruhura", "Kisoro", "Kitgum", "Koboko", "Kotido", "Kumi", "Kyenjojo", "Lira", "Luwero", "Manafwa", "Maracha", "Masaka", "Masindi", "Mayuge", "Mbale", "Mbarara", "Mityana", "Moroto", "Moyo", "Mpigi", "Mubende", "Mukono", "Nakapiripirit", "Nakaseke", "Nakasongola", "Nebbi", "Ntungamo", "Oyam", "Pader", "Pallisa", "Rakai", "Rukungiri", "Sembabule", "Sironko", "Soroti", "Tororo", "Wakiso", "Yumbe"] unless const_defined?("UGANDA_STATES")</td>
|
130
|
+
</tr>
|
131
|
+
<tr class="top-aligned-row context-row">
|
132
|
+
<td class="context-item-name">FRANCE_STATES</td>
|
133
|
+
<td>=</td>
|
134
|
+
<td class="context-item-value">["Alsace","Aquitaine","Auvergne","Bourgogne","Bretagne","Centre","Champagne-Ardenne","Corse","Franche-Comte","Ile-de-France","Languedoc-Roussillon","Limousin","Lorraine","Midi-Pyrenees","Nord-Pas-de-Calais","Basse-Normandie","Haute-Normandie","Pays de la Loire","Picardie","Poitou-Charentes","Provence-Alpes-Cote d'Azur","Rhone-Alpes"] unless const_defined?("FRENCE_STATES")</td>
|
135
|
+
</tr>
|
136
|
+
<tr class="top-aligned-row context-row">
|
137
|
+
<td class="context-item-name">GERMAN_STATES</td>
|
138
|
+
<td>=</td>
|
139
|
+
<td class="context-item-value">["Baden-Wurttemberg", "Bayern", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Mecklenburg- Vorpommern", "Niedersachsen", "Nordrhein-Westfalen", "Rhineland- Pflaz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig- Holstein", "Thuringen"] unless const_defined?("GERMAN_STATES")</td>
|
140
|
+
</tr>
|
141
|
+
</table>
|
142
|
+
</div>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
<!-- if method_list -->
|
151
|
+
<div id="methods">
|
152
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
153
|
+
|
154
|
+
<div id="method-M000002" class="method-detail">
|
155
|
+
<a name="M000002"></a>
|
156
|
+
|
157
|
+
<div class="method-heading">
|
158
|
+
<a href="#M000002" class="method-signature">
|
159
|
+
<span class="method-name">state_options_for_select</span><span class="method-args">(selected = nil, country = 'US')</span>
|
160
|
+
</a>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div class="method-description">
|
164
|
+
<p>
|
165
|
+
Returns a string of option tags for states in a country. Supply a state
|
166
|
+
name as <tt>selected</tt> to have it marked as the selected option tag.
|
167
|
+
</p>
|
168
|
+
<p>
|
169
|
+
NOTE: Only the option tags are returned, you have to wrap this call in a
|
170
|
+
regular HTML select tag.
|
171
|
+
</p>
|
172
|
+
<p><a class="source-toggle" href="#"
|
173
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
174
|
+
<div class="method-source-code" id="M000002-source">
|
175
|
+
<pre>
|
176
|
+
<span class="ruby-comment cmt"># File lib/state_select.rb, line 13</span>
|
177
|
+
13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">state_options_for_select</span>(<span class="ruby-identifier">selected</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">country</span> = <span class="ruby-value str">'US'</span>)
|
178
|
+
14: <span class="ruby-identifier">state_options</span> = <span class="ruby-value str">""</span>
|
179
|
+
15: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">country</span>
|
180
|
+
16: <span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">options_for_select</span>(<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">country</span>.<span class="ruby-identifier">upcase</span><span class="ruby-operator">+</span><span class="ruby-value str">'_STATES'</span>), <span class="ruby-identifier">selected</span>)
|
181
|
+
17: <span class="ruby-keyword kw">end</span>
|
182
|
+
18: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">state_options</span>
|
183
|
+
19: <span class="ruby-keyword kw">end</span>
|
184
|
+
</pre>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div id="method-M000001" class="method-detail">
|
190
|
+
<a name="M000001"></a>
|
191
|
+
|
192
|
+
<div class="method-heading">
|
193
|
+
<a href="#M000001" class="method-signature">
|
194
|
+
<span class="method-name">state_select</span><span class="method-args">(object, method, country='US', options = {}, html_options = {})</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p>
|
200
|
+
Return select and option tags for the given object and method, using <a
|
201
|
+
href="FormOptionsHelper.html#M000002">state_options_for_select</a> to
|
202
|
+
generate the list of option tags.
|
203
|
+
</p>
|
204
|
+
<p><a class="source-toggle" href="#"
|
205
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
206
|
+
<div class="method-source-code" id="M000001-source">
|
207
|
+
<pre>
|
208
|
+
<span class="ruby-comment cmt"># File lib/state_select.rb, line 4</span>
|
209
|
+
4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">state_select</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">country</span>=<span class="ruby-value str">'US'</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">html_options</span> = {})
|
210
|
+
5: <span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:object</span>)).<span class="ruby-identifier">to_state_select_tag</span>(<span class="ruby-identifier">country</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">html_options</span>)
|
211
|
+
6: <span class="ruby-keyword kw">end</span>
|
212
|
+
</pre>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
</div>
|
222
|
+
|
223
|
+
|
224
|
+
<div id="validator-badges">
|
225
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
</body>
|
229
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>state_select (ActionView::Helpers::FormOptionsHelper)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/state_select.rb, line 4</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">state_select</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">country</span>=<span class="ruby-value str">'US'</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-identifier">html_options</span> = {})
|
15
|
+
<span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceTag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">method</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:object</span>)).<span class="ruby-identifier">to_state_select_tag</span>(<span class="ruby-identifier">country</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">html_options</span>)
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>state_options_for_select (ActionView::Helpers::FormOptionsHelper)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/state_select.rb, line 13</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">state_options_for_select</span>(<span class="ruby-identifier">selected</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">country</span> = <span class="ruby-value str">'US'</span>)
|
15
|
+
<span class="ruby-identifier">state_options</span> = <span class="ruby-value str">""</span>
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">country</span>
|
17
|
+
<span class="ruby-identifier">state_options</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">options_for_select</span>(<span class="ruby-identifier">eval</span>(<span class="ruby-identifier">country</span><span class="ruby-operator">+</span><span class="ruby-value str">'_STATES'</span>), <span class="ruby-identifier">selected</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">state_options</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,150 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: ActionView::Helpers::InstanceTag</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">ActionView::Helpers::InstanceTag</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/state_select_rb.html">
|
59
|
+
lib/state_select.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000004">to_state_select_tag</a>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<!-- if includes -->
|
97
|
+
|
98
|
+
<div id="section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if method_list -->
|
108
|
+
<div id="methods">
|
109
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
110
|
+
|
111
|
+
<div id="method-M000004" class="method-detail">
|
112
|
+
<a name="M000004"></a>
|
113
|
+
|
114
|
+
<div class="method-heading">
|
115
|
+
<a href="#M000004" class="method-signature">
|
116
|
+
<span class="method-name">to_state_select_tag</span><span class="method-args">(country, options, html_options)</span>
|
117
|
+
</a>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="method-description">
|
121
|
+
<p><a class="source-toggle" href="#"
|
122
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
123
|
+
<div class="method-source-code" id="M000004-source">
|
124
|
+
<pre>
|
125
|
+
<span class="ruby-comment cmt"># File lib/state_select.rb, line 36</span>
|
126
|
+
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_state_select_tag</span>(<span class="ruby-identifier">country</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">html_options</span>)
|
127
|
+
37: <span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">html_options</span>.<span class="ruby-identifier">stringify_keys</span>
|
128
|
+
38: <span class="ruby-identifier">add_default_name_and_id</span>(<span class="ruby-identifier">html_options</span>)
|
129
|
+
39: <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>
|
130
|
+
40: <span class="ruby-identifier">selected_value</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:selected</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:selected</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span>
|
131
|
+
41: <span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"select"</span>, <span class="ruby-identifier">add_options</span>(<span class="ruby-identifier">state_options_for_select</span>(<span class="ruby-identifier">selected_value</span>, <span class="ruby-identifier">country</span>), <span class="ruby-identifier">options</span>, <span class="ruby-identifier">value</span>), <span class="ruby-identifier">html_options</span>)
|
132
|
+
42: <span class="ruby-keyword kw">end</span>
|
133
|
+
</pre>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
</div>
|
143
|
+
|
144
|
+
|
145
|
+
<div id="validator-badges">
|
146
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
</body>
|
150
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_state_select_tag (ActionView::Helpers::InstanceTag)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/state_select.rb, line 32</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_state_select_tag</span>(<span class="ruby-identifier">country</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">html_options</span>)
|
15
|
+
<span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">html_options</span>.<span class="ruby-identifier">stringify_keys</span>
|
16
|
+
<span class="ruby-identifier">add_default_name_and_id</span>(<span class="ruby-identifier">html_options</span>)
|
17
|
+
<span class="ruby-identifier">selected_value</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:selected</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:selected</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">value</span>
|
18
|
+
<span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"select"</span>, <span class="ruby-identifier">add_options</span>(<span class="ruby-identifier">state_options_for_select</span>(<span class="ruby-identifier">selected_value</span>, <span class="ruby-identifier">country</span>), <span class="ruby-identifier">options</span>, <span class="ruby-identifier">value</span>), <span class="ruby-identifier">html_options</span>)
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Fri Feb 09 16:24:28 India Standard Time 2007
|