country_state_select 3.0.3 → 3.0.5
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 +5 -5
- data/.travis.yml +1 -1
- data/README.md +3 -1
- data/Rakefile +1 -2
- data/app/controllers/country_state_select/cscs_controller.rb +6 -6
- data/config/routes.rb +2 -2
- data/country_state_select.gemspec +11 -11
- data/lib/country_state_select.rb +27 -36
- data/lib/country_state_select/version.rb +1 -1
- data/spec/country_state_select_spec.rb +33 -38
- data/spec/spec_helper.rb +2 -2
- metadata +3 -135
- data/test/dummy/.gitignore +0 -16
- data/test/dummy/Gemfile +0 -44
- data/test/dummy/README.rdoc +0 -3
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -19
- data/test/dummy/app/assets/javascripts/locations.coffee +0 -2
- data/test/dummy/app/assets/stylesheets/application.scss +0 -16
- data/test/dummy/app/assets/stylesheets/locations.css.scss +0 -3
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/locations_controller.rb +0 -55
- data/test/dummy/app/form/location_form.rb +0 -11
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/models/location.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -16
- data/test/dummy/app/views/locations/_form.html.erb +0 -14
- data/test/dummy/app/views/locations/index.html.erb +0 -29
- data/test/dummy/app/views/locations/new.html.erb +0 -13
- data/test/dummy/app/views/locations/show.html.erb +0 -13
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -4
- data/test/dummy/config/database.yml +0 -24
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -29
- data/test/dummy/config/environments/production.rb +0 -80
- data/test/dummy/config/environments/test.rb +0 -36
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -12
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/simple_form.rb +0 -165
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/locales/simple_form.en.yml +0 -31
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/db/migrate/20140724080030_create_locations.rb +0 -10
- data/test/dummy/db/migrate/20151024160724_add_test_city_to_locations.rb +0 -5
- data/test/dummy/db/schema.rb +0 -24
- data/test/dummy/db/seeds.rb +0 -7
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/lib/tasks/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -58
- data/test/dummy/public/422.html +0 -58
- data/test/dummy/public/500.html +0 -57
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/robots.txt +0 -5
- data/test/dummy/test/controllers/.keep +0 -0
- data/test/dummy/test/fixtures/.keep +0 -0
- data/test/dummy/test/helpers/.keep +0 -0
- data/test/dummy/test/integration/.keep +0 -0
- data/test/dummy/test/mailers/.keep +0 -0
- data/test/dummy/test/models/.keep +0 -0
- data/test/dummy/test/test_helper.rb +0 -15
- data/test/dummy/vendor/assets/javascripts/.keep +0 -0
- data/test/dummy/vendor/assets/stylesheets/.keep +0 -0
data/test/dummy/.gitignore
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
-
#
|
3
|
-
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
-
# or operating system, you probably want to add a global ignore instead:
|
5
|
-
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
-
|
7
|
-
# Ignore bundler config.
|
8
|
-
/.bundle
|
9
|
-
|
10
|
-
# Ignore the default SQLite database.
|
11
|
-
/db/*.sqlite3
|
12
|
-
/db/*.sqlite3-journal
|
13
|
-
|
14
|
-
# Ignore all logfiles and tempfiles.
|
15
|
-
/log/*.log
|
16
|
-
/tmp
|
data/test/dummy/Gemfile
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
group :development, :test do
|
4
|
-
gem "byebug", "~> 6.0"
|
5
|
-
gem "pry-rails", "~> 0.3"
|
6
|
-
gem "spring", "~> 1.4"
|
7
|
-
gem "web-console", "~> 2.2"
|
8
|
-
gem "thin", "~> 1.6"
|
9
|
-
gem "faker", "~> 1.5"
|
10
|
-
end
|
11
|
-
|
12
|
-
group :development do
|
13
|
-
gem "bullet", "~> 4.14"
|
14
|
-
gem "better_errors", "~> 2.1"
|
15
|
-
end
|
16
|
-
|
17
|
-
group :test do
|
18
|
-
gem "cucumber-rails", "~> 1.4", {:require=>false}
|
19
|
-
gem "rspec-rails", "~> 3.3"
|
20
|
-
gem "factory_girl_rails", "~> 4.5"
|
21
|
-
gem "capybara", "~> 2.5"
|
22
|
-
gem "database_cleaner", "~> 1.5"
|
23
|
-
gem "launchy", "~> 2.4"
|
24
|
-
gem "poltergeist", "~> 1.7"
|
25
|
-
gem "selenium-webdriver", "~> 2.47"
|
26
|
-
gem "simplecov", "~> 0.10"
|
27
|
-
end
|
28
|
-
|
29
|
-
gem 'chosen-rails'
|
30
|
-
gem "rails", "~> 4.2"
|
31
|
-
gem 'pg', '~> 0.18'
|
32
|
-
gem "sass-rails", "~> 5.0"
|
33
|
-
gem "uglifier", "~> 2.7"
|
34
|
-
gem "coffee-rails", "~> 4.1"
|
35
|
-
gem "jquery-rails", "~> 4.0"
|
36
|
-
gem "turbolinks", "~> 2.5"
|
37
|
-
gem "jbuilder", "~> 2.3"
|
38
|
-
gem "sdoc", "~> 0.4", {:group=>:doc}
|
39
|
-
gem "bootstrap-sass", "~> 3.3"
|
40
|
-
|
41
|
-
gem "simple_form", "~> 3.2"
|
42
|
-
gem "reform-rails"
|
43
|
-
|
44
|
-
gem 'country_state_select', path: '../../'
|
data/test/dummy/README.rdoc
DELETED
data/test/dummy/Rakefile
DELETED
File without changes
|
@@ -1,19 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require jquery
|
14
|
-
//= require bootstrap-sprockets
|
15
|
-
//= require jquery_ujs
|
16
|
-
//= require turbolinks
|
17
|
-
//= require chosen-jquery
|
18
|
-
//= require country_state_select
|
19
|
-
//= require_tree .
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*/
|
14
|
-
@import "bootstrap-sprockets";
|
15
|
-
@import "bootstrap";
|
16
|
-
@import "chosen";
|
File without changes
|
@@ -1,55 +0,0 @@
|
|
1
|
-
class LocationsController < ApplicationController
|
2
|
-
|
3
|
-
def index
|
4
|
-
@locations = Location.all
|
5
|
-
end
|
6
|
-
|
7
|
-
def new
|
8
|
-
build_location_form
|
9
|
-
end
|
10
|
-
|
11
|
-
def create
|
12
|
-
build_location_form
|
13
|
-
options = { flash: { success: "You've successfully created a location." } }
|
14
|
-
save_location_form(options) or render "new"
|
15
|
-
end
|
16
|
-
|
17
|
-
def show
|
18
|
-
load_location_form
|
19
|
-
end
|
20
|
-
|
21
|
-
def update
|
22
|
-
load_location_form
|
23
|
-
build_location_form
|
24
|
-
options = { flash: { success: "You've successfully updated location." } }
|
25
|
-
save_location_form(options) or render "show"
|
26
|
-
end
|
27
|
-
|
28
|
-
def destroy
|
29
|
-
@location ||= Location.find(params[:id])
|
30
|
-
@location.destroy
|
31
|
-
redirect_to locations_path, flash: { success: "You've successfully deleted this location." }
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
def location_params
|
36
|
-
params.require(:location).permit!
|
37
|
-
end
|
38
|
-
|
39
|
-
def build_location_form
|
40
|
-
@location ||= LocationForm.new(Location.new)
|
41
|
-
end
|
42
|
-
|
43
|
-
def load_location_form
|
44
|
-
@location ||= LocationForm.new(Location.find(params[:id]))
|
45
|
-
end
|
46
|
-
|
47
|
-
def save_location_form(options)
|
48
|
-
if @location.validate(params[:location])
|
49
|
-
@location.save
|
50
|
-
redirect_to locations_path, options
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
end
|
File without changes
|
data/test/dummy/app/models/.keep
DELETED
File without changes
|
File without changes
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Locations</title>
|
5
|
-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => false %>
|
6
|
-
<%= javascript_include_tag 'application', 'data-turbolinks-track' => false %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<div class="container">
|
12
|
-
<%= yield %>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
</body>
|
16
|
-
</html>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= simple_form_for @location do |f| %>
|
2
|
-
|
3
|
-
<%= f.input :test_country, label: "Country", collection: CountryStateSelect.countries_collection %>
|
4
|
-
|
5
|
-
<%= f.input :test_state, CountryStateSelect.state_options(label: "State / Province", form: f, field_names: { :country => :test_country, :state => :home_state } ) %>
|
6
|
-
<%= f.input :test_city, CountryStateSelect.city_options(label: "City ", form: f, field_names: { :state => :test_state, :city => :home_city } ) %>
|
7
|
-
|
8
|
-
<br /><br />
|
9
|
-
|
10
|
-
<%= f.button :submit %>
|
11
|
-
|
12
|
-
<%= link_to "Cancel", locations_path, class: "btn btn-danger" %>
|
13
|
-
|
14
|
-
<% end %>
|
@@ -1,29 +0,0 @@
|
|
1
|
-
<h1>Listing Locations</h1>
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<thead>
|
5
|
-
<tr>
|
6
|
-
<th>Country</th>
|
7
|
-
<td> </td>
|
8
|
-
<th>State</th>
|
9
|
-
<td> </td>
|
10
|
-
<td> </td>
|
11
|
-
</tr>
|
12
|
-
</thead>
|
13
|
-
|
14
|
-
<tbody>
|
15
|
-
<% @locations.each do |location| %>
|
16
|
-
<tr>
|
17
|
-
<td><%= location.test_country %></td>
|
18
|
-
<td> </td>
|
19
|
-
<td><%= location.test_state %></td>
|
20
|
-
<td> </td>
|
21
|
-
<td><%= link_to "X", location, :method => :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %></td>
|
22
|
-
</tr>
|
23
|
-
<% end %>
|
24
|
-
</tbody>
|
25
|
-
</table>
|
26
|
-
|
27
|
-
<br>
|
28
|
-
|
29
|
-
<%= link_to 'New Location', new_location_path, class: "btn btn-success" %>
|
data/test/dummy/bin/bundle
DELETED
data/test/dummy/bin/rails
DELETED
data/test/dummy/bin/rake
DELETED
data/test/dummy/config.ru
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
2
|
-
|
3
|
-
require 'rails/all'
|
4
|
-
|
5
|
-
# Require the gems listed in Gemfile, including any gems
|
6
|
-
# you've limited to :test, :development, or :production.
|
7
|
-
Bundler.require(*Rails.groups)
|
8
|
-
|
9
|
-
module Dummy
|
10
|
-
class Application < Rails::Application
|
11
|
-
# Settings in config/environments/* take precedence over those specified here.
|
12
|
-
# Application configuration should go into files in config/initializers
|
13
|
-
# -- all .rb files in that directory are automatically loaded.
|
14
|
-
|
15
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
16
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
17
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
18
|
-
|
19
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
20
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
21
|
-
# config.i18n.default_locale = :de
|
22
|
-
end
|
23
|
-
end
|
data/test/dummy/config/boot.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
default: &default
|
2
|
-
adapter: postgresql
|
3
|
-
encoding: unicode
|
4
|
-
pool: 5
|
5
|
-
username:
|
6
|
-
password:
|
7
|
-
prepared_statements: false
|
8
|
-
|
9
|
-
development:
|
10
|
-
<<: *default
|
11
|
-
database: cst-development
|
12
|
-
|
13
|
-
test:
|
14
|
-
<<: *default
|
15
|
-
database: cst_test
|
16
|
-
|
17
|
-
staging:
|
18
|
-
<<: *default
|
19
|
-
database: cst_staging
|
20
|
-
|
21
|
-
production:
|
22
|
-
<<: *default
|
23
|
-
database: cst_release_production
|
24
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
-
|
4
|
-
# In the development environment your application's code is reloaded on
|
5
|
-
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
7
|
-
config.cache_classes = false
|
8
|
-
|
9
|
-
# Do not eager load code on boot.
|
10
|
-
config.eager_load = false
|
11
|
-
|
12
|
-
# Show full error reports and disable caching.
|
13
|
-
config.consider_all_requests_local = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Don't care if the mailer can't send.
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
18
|
-
|
19
|
-
# Print deprecation notices to the Rails logger.
|
20
|
-
config.active_support.deprecation = :log
|
21
|
-
|
22
|
-
# Raise an error on page load if there are pending migrations
|
23
|
-
config.active_record.migration_error = :page_load
|
24
|
-
|
25
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
-
# This option may cause significant delays in view rendering with a large
|
27
|
-
# number of complex assets.
|
28
|
-
config.assets.debug = true
|
29
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
-
|
4
|
-
# Code is not reloaded between requests.
|
5
|
-
config.cache_classes = true
|
6
|
-
|
7
|
-
# Eager load code on boot. This eager loads most of Rails and
|
8
|
-
# your application in memory, allowing both thread web servers
|
9
|
-
# and those relying on copy on write to perform better.
|
10
|
-
# Rake tasks automatically ignore this option for performance.
|
11
|
-
config.eager_load = true
|
12
|
-
|
13
|
-
# Full error reports are disabled and caching is turned on.
|
14
|
-
config.consider_all_requests_local = false
|
15
|
-
config.action_controller.perform_caching = true
|
16
|
-
|
17
|
-
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
-
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
-
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
-
# config.action_dispatch.rack_cache = true
|
21
|
-
|
22
|
-
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
-
config.serve_static_assets = false
|
24
|
-
|
25
|
-
# Compress JavaScripts and CSS.
|
26
|
-
config.assets.js_compressor = :uglifier
|
27
|
-
# config.assets.css_compressor = :sass
|
28
|
-
|
29
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
-
config.assets.compile = false
|
31
|
-
|
32
|
-
# Generate digests for assets URLs.
|
33
|
-
config.assets.digest = true
|
34
|
-
|
35
|
-
# Version of your assets, change this if you want to expire all your assets.
|
36
|
-
config.assets.version = '1.0'
|
37
|
-
|
38
|
-
# Specifies the header that your server uses for sending files.
|
39
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
40
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
41
|
-
|
42
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
-
# config.force_ssl = true
|
44
|
-
|
45
|
-
# Set to :debug to see everything in the log.
|
46
|
-
config.log_level = :info
|
47
|
-
|
48
|
-
# Prepend all log lines with the following tags.
|
49
|
-
# config.log_tags = [ :subdomain, :uuid ]
|
50
|
-
|
51
|
-
# Use a different logger for distributed setups.
|
52
|
-
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
53
|
-
|
54
|
-
# Use a different cache store in production.
|
55
|
-
# config.cache_store = :mem_cache_store
|
56
|
-
|
57
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
59
|
-
|
60
|
-
# Precompile additional assets.
|
61
|
-
# application.js, application.scss, and all non-JS/CSS in app/assets folder are already added.
|
62
|
-
# config.assets.precompile += %w( search.js )
|
63
|
-
|
64
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
|
-
# config.action_mailer.raise_delivery_errors = false
|
67
|
-
|
68
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
-
# the I18n.default_locale when a translation can not be found).
|
70
|
-
config.i18n.fallbacks = true
|
71
|
-
|
72
|
-
# Send deprecation notices to registered listeners.
|
73
|
-
config.active_support.deprecation = :notify
|
74
|
-
|
75
|
-
# Disable automatic flushing of the log to improve performance.
|
76
|
-
# config.autoflush_log = false
|
77
|
-
|
78
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
-
config.log_formatter = ::Logger::Formatter.new
|
80
|
-
end
|