country_state_select 3.0.3 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +1 -1
  3. data/README.md +3 -1
  4. data/Rakefile +1 -2
  5. data/app/controllers/country_state_select/cscs_controller.rb +6 -6
  6. data/config/routes.rb +2 -2
  7. data/country_state_select.gemspec +11 -11
  8. data/lib/country_state_select.rb +27 -36
  9. data/lib/country_state_select/version.rb +1 -1
  10. data/spec/country_state_select_spec.rb +33 -38
  11. data/spec/spec_helper.rb +2 -2
  12. metadata +3 -135
  13. data/test/dummy/.gitignore +0 -16
  14. data/test/dummy/Gemfile +0 -44
  15. data/test/dummy/README.rdoc +0 -3
  16. data/test/dummy/Rakefile +0 -6
  17. data/test/dummy/app/assets/images/.keep +0 -0
  18. data/test/dummy/app/assets/javascripts/application.js +0 -19
  19. data/test/dummy/app/assets/javascripts/locations.coffee +0 -2
  20. data/test/dummy/app/assets/stylesheets/application.scss +0 -16
  21. data/test/dummy/app/assets/stylesheets/locations.css.scss +0 -3
  22. data/test/dummy/app/controllers/application_controller.rb +0 -5
  23. data/test/dummy/app/controllers/concerns/.keep +0 -0
  24. data/test/dummy/app/controllers/locations_controller.rb +0 -55
  25. data/test/dummy/app/form/location_form.rb +0 -11
  26. data/test/dummy/app/helpers/application_helper.rb +0 -2
  27. data/test/dummy/app/mailers/.keep +0 -0
  28. data/test/dummy/app/models/.keep +0 -0
  29. data/test/dummy/app/models/concerns/.keep +0 -0
  30. data/test/dummy/app/models/location.rb +0 -2
  31. data/test/dummy/app/views/layouts/application.html.erb +0 -16
  32. data/test/dummy/app/views/locations/_form.html.erb +0 -14
  33. data/test/dummy/app/views/locations/index.html.erb +0 -29
  34. data/test/dummy/app/views/locations/new.html.erb +0 -13
  35. data/test/dummy/app/views/locations/show.html.erb +0 -13
  36. data/test/dummy/bin/bundle +0 -3
  37. data/test/dummy/bin/rails +0 -4
  38. data/test/dummy/bin/rake +0 -4
  39. data/test/dummy/config.ru +0 -4
  40. data/test/dummy/config/application.rb +0 -23
  41. data/test/dummy/config/boot.rb +0 -4
  42. data/test/dummy/config/database.yml +0 -24
  43. data/test/dummy/config/environment.rb +0 -5
  44. data/test/dummy/config/environments/development.rb +0 -29
  45. data/test/dummy/config/environments/production.rb +0 -80
  46. data/test/dummy/config/environments/test.rb +0 -36
  47. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  48. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  49. data/test/dummy/config/initializers/inflections.rb +0 -16
  50. data/test/dummy/config/initializers/mime_types.rb +0 -5
  51. data/test/dummy/config/initializers/secret_token.rb +0 -12
  52. data/test/dummy/config/initializers/session_store.rb +0 -3
  53. data/test/dummy/config/initializers/simple_form.rb +0 -165
  54. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  55. data/test/dummy/config/locales/en.yml +0 -23
  56. data/test/dummy/config/locales/simple_form.en.yml +0 -31
  57. data/test/dummy/config/routes.rb +0 -4
  58. data/test/dummy/db/migrate/20140724080030_create_locations.rb +0 -10
  59. data/test/dummy/db/migrate/20151024160724_add_test_city_to_locations.rb +0 -5
  60. data/test/dummy/db/schema.rb +0 -24
  61. data/test/dummy/db/seeds.rb +0 -7
  62. data/test/dummy/lib/assets/.keep +0 -0
  63. data/test/dummy/lib/tasks/.keep +0 -0
  64. data/test/dummy/log/.keep +0 -0
  65. data/test/dummy/public/404.html +0 -58
  66. data/test/dummy/public/422.html +0 -58
  67. data/test/dummy/public/500.html +0 -57
  68. data/test/dummy/public/favicon.ico +0 -0
  69. data/test/dummy/public/robots.txt +0 -5
  70. data/test/dummy/test/controllers/.keep +0 -0
  71. data/test/dummy/test/fixtures/.keep +0 -0
  72. data/test/dummy/test/helpers/.keep +0 -0
  73. data/test/dummy/test/integration/.keep +0 -0
  74. data/test/dummy/test/mailers/.keep +0 -0
  75. data/test/dummy/test/models/.keep +0 -0
  76. data/test/dummy/test/test_helper.rb +0 -15
  77. data/test/dummy/vendor/assets/javascripts/.keep +0 -0
  78. data/test/dummy/vendor/assets/stylesheets/.keep +0 -0
@@ -1,36 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
-
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
17
- config.static_cache_control = "public, max-age=3600"
18
-
19
- # Show full error reports and disable caching.
20
- config.consider_all_requests_local = true
21
- config.action_controller.perform_caching = false
22
-
23
- # Raise exceptions instead of rendering exception templates.
24
- config.action_dispatch.show_exceptions = false
25
-
26
- # Disable request forgery protection in test environment.
27
- config.action_controller.allow_forgery_protection = false
28
-
29
- # Tell Action Mailer not to deliver emails to the real world.
30
- # The :test delivery method accumulates sent emails in the
31
- # ActionMailer::Base.deliveries array.
32
- config.action_mailer.delivery_method = :test
33
-
34
- # Print deprecation notices to the stderr.
35
- config.active_support.deprecation = :stderr
36
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,16 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format. Inflections
4
- # are locale specific, and you may define rules for as many different
5
- # locales as you wish. All of these examples are active by default:
6
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
- # inflect.plural /^(ox)$/i, '\1en'
8
- # inflect.singular /^(ox)en/i, '\1'
9
- # inflect.irregular 'person', 'people'
10
- # inflect.uncountable %w( fish sheep )
11
- # end
12
-
13
- # These inflection rules are supported but not enabled by default:
14
- # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
- # inflect.acronym 'RESTful'
16
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure your secret_key_base is kept private
11
- # if you're sharing your code publicly.
12
- Dummy::Application.config.secret_key_base = '27ca519cacee7a1b0cc523b2774d35864eb73e46a69ae3e6e9fead85aea6e6287dc3f5140b6c65a77a7d86439bfd2d036deba927ef94e14d77cb07c983102f76'
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,165 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- # Wrappers are used by the form builder to generate a
4
- # complete input. You can remove any component from the
5
- # wrapper, change the order or even add your own to the
6
- # stack. The options given below are used to wrap the
7
- # whole input.
8
- config.wrappers :default, class: :input,
9
- hint_class: :field_with_hint, error_class: :field_with_errors do |b|
10
- ## Extensions enabled by default
11
- # Any of these extensions can be disabled for a
12
- # given input by passing: `f.input EXTENSION_NAME => false`.
13
- # You can make any of these extensions optional by
14
- # renaming `b.use` to `b.optional`.
15
-
16
- # Determines whether to use HTML5 (:email, :url, ...)
17
- # and required attributes
18
- b.use :html5
19
-
20
- # Calculates placeholders automatically from I18n
21
- # You can also pass a string as f.input placeholder: "Placeholder"
22
- b.use :placeholder
23
-
24
- ## Optional extensions
25
- # They are disabled unless you pass `f.input EXTENSION_NAME => true`
26
- # to the input. If so, they will retrieve the values from the model
27
- # if any exists. If you want to enable any of those
28
- # extensions by default, you can change `b.optional` to `b.use`.
29
-
30
- # Calculates maxlength from length validations for string inputs
31
- b.optional :maxlength
32
-
33
- # Calculates pattern from format validations for string inputs
34
- b.optional :pattern
35
-
36
- # Calculates min and max from length validations for numeric inputs
37
- b.optional :min_max
38
-
39
- # Calculates readonly automatically from readonly attributes
40
- b.optional :readonly
41
-
42
- ## Inputs
43
- b.use :label_input
44
- b.use :hint, wrap_with: { tag: :span, class: :hint }
45
- b.use :error, wrap_with: { tag: :span, class: :error }
46
-
47
- ## full_messages_for
48
- # If you want to display the full error message for the attribute, you can
49
- # use the component :full_error, like:
50
- #
51
- # b.use :full_error, wrap_with: { tag: :span, class: :error }
52
- end
53
-
54
- # The default wrapper to be used by the FormBuilder.
55
- config.default_wrapper = :default
56
-
57
- # Define the way to render check boxes / radio buttons with labels.
58
- # Defaults to :nested for bootstrap config.
59
- # inline: input + label
60
- # nested: label > input
61
- config.boolean_style = :nested
62
-
63
- # Default class for buttons
64
- config.button_class = 'btn'
65
-
66
- # Method used to tidy up errors. Specify any Rails Array method.
67
- # :first lists the first message for each field.
68
- # Use :to_sentence to list all errors for each field.
69
- # config.error_method = :first
70
-
71
- # Default tag used for error notification helper.
72
- config.error_notification_tag = :div
73
-
74
- # CSS class to add for error notification helper.
75
- config.error_notification_class = 'error_notification'
76
-
77
- # ID to add for error notification helper.
78
- # config.error_notification_id = nil
79
-
80
- # Series of attempts to detect a default label method for collection.
81
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
82
-
83
- # Series of attempts to detect a default value method for collection.
84
- # config.collection_value_methods = [ :id, :to_s ]
85
-
86
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
87
- # config.collection_wrapper_tag = nil
88
-
89
- # You can define the class to use on all collection wrappers. Defaulting to none.
90
- # config.collection_wrapper_class = nil
91
-
92
- # You can wrap each item in a collection of radio/check boxes with a tag,
93
- # defaulting to :span.
94
- # config.item_wrapper_tag = :span
95
-
96
- # You can define a class to use in all item wrappers. Defaulting to none.
97
- # config.item_wrapper_class = nil
98
-
99
- # How the label text should be generated altogether with the required text.
100
- # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
101
-
102
- # You can define the class to use on all labels. Default is nil.
103
- # config.label_class = nil
104
-
105
- # You can define the default class to be used on forms. Can be overriden
106
- # with `html: { :class }`. Defaulting to none.
107
- # config.default_form_class = nil
108
-
109
- # You can define which elements should obtain additional classes
110
- # config.generate_additional_classes_for = [:wrapper, :label, :input]
111
-
112
- # Whether attributes are required by default (or not). Default is true.
113
- # config.required_by_default = true
114
-
115
- # Tell browsers whether to use the native HTML5 validations (novalidate form option).
116
- # These validations are enabled in SimpleForm's internal config but disabled by default
117
- # in this configuration, which is recommended due to some quirks from different browsers.
118
- # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
119
- # change this configuration to true.
120
- config.browser_validations = false
121
-
122
- # Collection of methods to detect if a file type was given.
123
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
124
-
125
- # Custom mappings for input types. This should be a hash containing a regexp
126
- # to match as key, and the input type that will be used when the field name
127
- # matches the regexp as value.
128
- # config.input_mappings = { /count/ => :integer }
129
-
130
- # Custom wrappers for input types. This should be a hash containing an input
131
- # type as key and the wrapper that will be used for all inputs with specified type.
132
- # config.wrapper_mappings = { string: :prepend }
133
-
134
- # Namespaces where SimpleForm should look for custom input classes that
135
- # override default inputs.
136
- # config.custom_inputs_namespaces << "CustomInputs"
137
-
138
- # Default priority for time_zone inputs.
139
- # config.time_zone_priority = nil
140
-
141
- # Default priority for country inputs.
142
- # config.country_priority = nil
143
-
144
- # When false, do not use translations for labels.
145
- # config.translate_labels = true
146
-
147
- # Automatically discover new inputs in Rails' autoload path.
148
- # config.inputs_discovery = true
149
-
150
- # Cache SimpleForm inputs discovery
151
- # config.cache_discovery = !Rails.env.development?
152
-
153
- # Default class for inputs
154
- # config.input_class = nil
155
-
156
- # Define the default class of the input wrapper of the boolean input.
157
- config.boolean_label_class = 'checkbox'
158
-
159
- # Defines if the default input wrapper class should be included in radio
160
- # collection wrappers.
161
- # config.include_default_input_wrapper_class = true
162
-
163
- # Defines which i18n scope will be used in Simple Form.
164
- # config.i18n_scope = 'simple_form'
165
- end
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
- end
10
-
11
- # To enable root element in JSON for ActiveRecord objects.
12
- # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
14
- # end
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,31 +0,0 @@
1
- en:
2
- simple_form:
3
- "yes": 'Yes'
4
- "no": 'No'
5
- required:
6
- text: 'required'
7
- mark: '*'
8
- # You can uncomment the line below if you need to overwrite the whole required html.
9
- # When using html, text and mark won't be used.
10
- # html: '<abbr title="required">*</abbr>'
11
- error_notification:
12
- default_message: "Please review the problems below:"
13
- # Examples
14
- # labels:
15
- # defaults:
16
- # password: 'Password'
17
- # user:
18
- # new:
19
- # email: 'E-mail to sign in.'
20
- # edit:
21
- # email: 'E-mail.'
22
- # hints:
23
- # defaults:
24
- # username: 'User name to sign in.'
25
- # password: 'No special characters, please.'
26
- # include_blanks:
27
- # defaults:
28
- # age: 'Rather not say'
29
- # prompts:
30
- # defaults:
31
- # age: 'Select your age'
@@ -1,4 +0,0 @@
1
- Dummy::Application.routes.draw do
2
- resources :locations
3
- root 'locations#index'
4
- end
@@ -1,10 +0,0 @@
1
- class CreateLocations < ActiveRecord::Migration
2
- def change
3
- create_table :locations do |t|
4
- t.string :test_country
5
- t.string :test_state
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,5 +0,0 @@
1
- class AddTestCityToLocations < ActiveRecord::Migration
2
- def change
3
- add_column :locations, :test_city, :string
4
- end
5
- end
@@ -1,24 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended that you check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(version: 20151024160724) do
15
-
16
- create_table "locations", force: :cascade do |t|
17
- t.string "test_country"
18
- t.string "test_state"
19
- t.datetime "created_at"
20
- t.datetime "updated_at"
21
- t.string "test_city"
22
- end
23
-
24
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
- # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
@@ -1,58 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style>
6
- body {
7
- background-color: #EFEFEF;
8
- color: #2E2F30;
9
- text-align: center;
10
- font-family: arial, sans-serif;
11
- }
12
-
13
- div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
- border: 1px solid #CCC;
17
- border-right-color: #999;
18
- border-left-color: #999;
19
- border-bottom-color: #BBB;
20
- border-top: #B00100 solid 4px;
21
- border-top-left-radius: 9px;
22
- border-top-right-radius: 9px;
23
- background-color: white;
24
- padding: 7px 4em 0 4em;
25
- }
26
-
27
- h1 {
28
- font-size: 100%;
29
- color: #730E15;
30
- line-height: 1.5em;
31
- }
32
-
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
37
- background-color: #F7F7F7;
38
- border: 1px solid #CCC;
39
- border-right-color: #999;
40
- border-bottom-color: #999;
41
- border-bottom-left-radius: 4px;
42
- border-bottom-right-radius: 4px;
43
- border-top-color: #DADADA;
44
- color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
- }
47
- </style>
48
- </head>
49
-
50
- <body>
51
- <!-- This file lives in public/404.html -->
52
- <div class="dialog">
53
- <h1>The page you were looking for doesn't exist.</h1>
54
- <p>You may have mistyped the address or the page may have moved.</p>
55
- </div>
56
- <p>If you are the application owner check the logs for more information.</p>
57
- </body>
58
- </html>