au_state_select 1.1 → 1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/au_state_select/instance_tag.rb +11 -7
- data/lib/au_state_select/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54980a071b0097856c01c7ef49e005bc8138f29f
|
|
4
|
+
data.tar.gz: 2597a1b2b589add45dd68c5de9018ac9b31df824
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f4268bdfecdf6df8d1c7c2708395873626f16057fd33c479cae9e9a7ab99c74b44b109c156b00c55043d897667da2bec33fd8b8abea4a329c5b4b1568736ec5
|
|
7
|
+
data.tar.gz: 48723b83fd4634371b3c49e5e1920190635a3cfe858ab088f2d99043f075013748bf041dd4f8d615d45e61e409f6ed485c93543a09d9f4b4da794964353dbfe4
|
|
@@ -13,23 +13,27 @@ module AUStateSelect
|
|
|
13
13
|
def state_select(priority_states, options, html_options)
|
|
14
14
|
selected = object.send(@method_name) if object.respond_to?(@method_name)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
states = ""
|
|
17
17
|
|
|
18
18
|
if options.present? and (options[:include_blank] or (options[:prompt] and !selected))
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if options[:include_blank].present?
|
|
20
|
+
option = options[:include_blank] == true ? "" : options[:include_blank]
|
|
21
|
+
elsif options[:prompt].present?
|
|
22
|
+
option = options[:prompt] == true ? "Please Select" : options[:prompt]
|
|
23
|
+
end
|
|
24
|
+
states += "<option>#{option}</option>\n"
|
|
21
25
|
end
|
|
22
26
|
|
|
23
27
|
if priority_states
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
states += options_for_select(priority_states, selected)
|
|
29
|
+
states += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
|
|
26
30
|
end
|
|
27
|
-
|
|
31
|
+
states = states + options_for_select([['Australian Capital Territory', 'ACT'],['New South Wales', 'NSW'],['Northern Territory', 'NT'],['Queensland', 'QLD'],['South Australia', 'SA'],['Tasmania', 'TAS'],['Victoria', 'VIC'],['Western Australia', 'WA']], selected)
|
|
28
32
|
|
|
29
33
|
html_options = html_options.stringify_keys
|
|
30
34
|
add_default_name_and_id(html_options)
|
|
31
35
|
|
|
32
|
-
content_tag(:select,
|
|
36
|
+
content_tag(:select, states.html_safe, html_options)
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: au_state_select
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.2'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Zhang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|