country_select 4.0.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -31
  3. data/CHANGELOG.md +21 -0
  4. data/Gemfile +0 -6
  5. data/Gemfile.lock +63 -265
  6. data/README.md +15 -2
  7. data/Rakefile +3 -1
  8. data/country_select.gemspec +7 -9
  9. data/gemfiles/actionpack.edge.gemfile +0 -6
  10. data/gemfiles/actionpack.edge.gemfile.lock +63 -268
  11. data/gemfiles/actionpack5.2.gemfile +2 -8
  12. data/gemfiles/actionpack5.2.gemfile.lock +59 -266
  13. data/gemfiles/actionpack6.0.gemfile +6 -0
  14. data/gemfiles/actionpack6.0.gemfile.lock +107 -0
  15. data/gemfiles/actionpack6.1.gemfile +6 -0
  16. data/gemfiles/actionpack6.1.gemfile.lock +106 -0
  17. data/lib/country_select.rb +2 -6
  18. data/lib/country_select/defaults.rb +10 -0
  19. data/lib/country_select/formats.rb +3 -1
  20. data/lib/country_select/tag_helper.rb +7 -7
  21. data/lib/country_select/version.rb +1 -1
  22. data/lib/country_select_without_sort_alphabetical.rb +2 -6
  23. data/spec/country_select_spec.rb +43 -3
  24. metadata +25 -34
  25. data/gemfiles/actionpack3.2.gemfile +0 -11
  26. data/gemfiles/actionpack3.2.gemfile.lock +0 -297
  27. data/gemfiles/actionpack4.0.gemfile +0 -11
  28. data/gemfiles/actionpack4.0.gemfile.lock +0 -286
  29. data/gemfiles/actionpack4.1.gemfile +0 -11
  30. data/gemfiles/actionpack4.1.gemfile.lock +0 -290
  31. data/gemfiles/actionpack4.2.gemfile +0 -14
  32. data/gemfiles/actionpack4.2.gemfile.lock +0 -306
  33. data/gemfiles/actionpack5.0.gemfile +0 -12
  34. data/gemfiles/actionpack5.0.gemfile.lock +0 -311
  35. data/gemfiles/actionpack5.1.gemfile +0 -12
  36. data/gemfiles/actionpack5.1.gemfile.lock +0 -311
  37. data/lib/country_select/rails3/country_select_helper.rb +0 -39
@@ -1,39 +0,0 @@
1
- module ActionView
2
- module Helpers
3
- class FormBuilder
4
- def country_select(method, priority_or_options = {}, options = {}, html_options = {})
5
- if Hash === priority_or_options
6
- html_options = options
7
- options = priority_or_options
8
- else
9
- options[:priority_countries] = priority_or_options
10
- end
11
-
12
- @template.country_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
13
- end
14
- end
15
-
16
- module FormOptionsHelper
17
- def country_select(object, method, options = {}, html_options = {})
18
- CountrySelect.new(object, method, self, options.delete(:object)).render(options, html_options)
19
- end
20
- end
21
-
22
- class CountrySelect < InstanceTag
23
- include ::CountrySelect::TagHelper
24
-
25
- def render(options, html_options)
26
- @options = options
27
- @html_options = html_options
28
-
29
- if self.respond_to?(:select_content_tag)
30
- select_content_tag(country_option_tags, @options, @html_options)
31
- else
32
- html_options = @html_options.stringify_keys
33
- add_default_name_and_id(html_options)
34
- content_tag(:select, add_options(country_option_tags, options, value(object)), html_options)
35
- end
36
- end
37
- end
38
- end
39
- end