autocomplete_zipcode 0.1.2 → 0.1.2.1

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -3
  3. data/lib/autocomplete_zipcode/version.rb +1 -1
  4. data/vendor/assets/javascripts/autocomplete_zipcode.js +1 -1
  5. metadata +2 -99
  6. data/example/.gitignore +0 -21
  7. data/example/Gemfile +0 -55
  8. data/example/Gemfile.lock +0 -184
  9. data/example/README.md +0 -24
  10. data/example/Rakefile +0 -6
  11. data/example/app/assets/config/manifest.js +0 -3
  12. data/example/app/assets/images/.keep +0 -0
  13. data/example/app/assets/javascripts/addresses.coffee +0 -3
  14. data/example/app/assets/javascripts/application.js +0 -26
  15. data/example/app/assets/javascripts/cable.js +0 -13
  16. data/example/app/assets/javascripts/channels/.keep +0 -0
  17. data/example/app/assets/stylesheets/addresses.scss +0 -3
  18. data/example/app/assets/stylesheets/application.css +0 -15
  19. data/example/app/assets/stylesheets/scaffolds.scss +0 -89
  20. data/example/app/channels/application_cable/channel.rb +0 -4
  21. data/example/app/channels/application_cable/connection.rb +0 -4
  22. data/example/app/controllers/addresses_controller.rb +0 -74
  23. data/example/app/controllers/application_controller.rb +0 -3
  24. data/example/app/controllers/concerns/.keep +0 -0
  25. data/example/app/helpers/addresses_helper.rb +0 -2
  26. data/example/app/helpers/application_helper.rb +0 -2
  27. data/example/app/jobs/application_job.rb +0 -2
  28. data/example/app/mailers/application_mailer.rb +0 -4
  29. data/example/app/models/address.rb +0 -2
  30. data/example/app/models/application_record.rb +0 -3
  31. data/example/app/models/concerns/.keep +0 -0
  32. data/example/app/views/addresses/_address.json.jbuilder +0 -2
  33. data/example/app/views/addresses/_form.html.erb +0 -18
  34. data/example/app/views/addresses/edit.html.erb +0 -6
  35. data/example/app/views/addresses/index.html.erb +0 -33
  36. data/example/app/views/addresses/index.json.jbuilder +0 -1
  37. data/example/app/views/addresses/new.html.erb +0 -5
  38. data/example/app/views/addresses/show.html.erb +0 -24
  39. data/example/app/views/addresses/show.json.jbuilder +0 -1
  40. data/example/app/views/layouts/application.html.erb +0 -14
  41. data/example/app/views/layouts/mailer.html.erb +0 -13
  42. data/example/app/views/layouts/mailer.text.erb +0 -1
  43. data/example/bin/bundle +0 -3
  44. data/example/bin/rails +0 -9
  45. data/example/bin/rake +0 -9
  46. data/example/bin/setup +0 -34
  47. data/example/bin/spring +0 -17
  48. data/example/bin/update +0 -29
  49. data/example/config.ru +0 -5
  50. data/example/config/application.rb +0 -15
  51. data/example/config/boot.rb +0 -3
  52. data/example/config/cable.yml +0 -9
  53. data/example/config/database.yml +0 -25
  54. data/example/config/environment.rb +0 -5
  55. data/example/config/environments/development.rb +0 -54
  56. data/example/config/environments/production.rb +0 -86
  57. data/example/config/environments/test.rb +0 -42
  58. data/example/config/initializers/application_controller_renderer.rb +0 -6
  59. data/example/config/initializers/assets.rb +0 -11
  60. data/example/config/initializers/backtrace_silencers.rb +0 -7
  61. data/example/config/initializers/cookies_serializer.rb +0 -5
  62. data/example/config/initializers/filter_parameter_logging.rb +0 -4
  63. data/example/config/initializers/inflections.rb +0 -16
  64. data/example/config/initializers/mime_types.rb +0 -4
  65. data/example/config/initializers/new_framework_defaults.rb +0 -24
  66. data/example/config/initializers/session_store.rb +0 -3
  67. data/example/config/initializers/simple_form.rb +0 -169
  68. data/example/config/initializers/wrap_parameters.rb +0 -14
  69. data/example/config/locales/en.yml +0 -23
  70. data/example/config/locales/simple_form.en.yml +0 -31
  71. data/example/config/puma.rb +0 -47
  72. data/example/config/routes.rb +0 -4
  73. data/example/config/secrets.yml +0 -22
  74. data/example/config/spring.rb +0 -6
  75. data/example/db/migrate/20170425234824_create_addresses.rb +0 -13
  76. data/example/db/schema.rb +0 -25
  77. data/example/db/seeds.rb +0 -7
  78. data/example/lib/assets/.keep +0 -0
  79. data/example/lib/tasks/.keep +0 -0
  80. data/example/lib/templates/erb/scaffold/_form.html.erb +0 -13
  81. data/example/log/.keep +0 -0
  82. data/example/public/404.html +0 -67
  83. data/example/public/422.html +0 -67
  84. data/example/public/500.html +0 -66
  85. data/example/public/apple-touch-icon-precomposed.png +0 -0
  86. data/example/public/apple-touch-icon.png +0 -0
  87. data/example/public/favicon.ico +0 -0
  88. data/example/public/robots.txt +0 -5
  89. data/example/test/controllers/.keep +0 -0
  90. data/example/test/controllers/addresses_controller_test.rb +0 -48
  91. data/example/test/fixtures/.keep +0 -0
  92. data/example/test/fixtures/addresses.yml +0 -13
  93. data/example/test/fixtures/files/.keep +0 -0
  94. data/example/test/helpers/.keep +0 -0
  95. data/example/test/integration/.keep +0 -0
  96. data/example/test/mailers/.keep +0 -0
  97. data/example/test/models/.keep +0 -0
  98. data/example/test/models/address_test.rb +0 -7
  99. data/example/test/test_helper.rb +0 -10
  100. data/example/tmp/.keep +0 -0
  101. data/example/vendor/assets/javascripts/.keep +0 -0
  102. data/example/vendor/assets/stylesheets/.keep +0 -0
@@ -1,24 +0,0 @@
1
- # README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
File without changes
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,26 +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. JavaScript code in this file should be added after the last require_* statement.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require turbolinks
16
- //= require autocomplete_zipcode
17
- //= require_tree .
18
-
19
- $(document).on("turbolinks:load", function() {
20
- document.addEventListener('zipcode.error', function(e) {
21
- $('#error').show()
22
- setTimeout(function() {
23
- $('#error').fadeOut(1000);
24
- }, 5000);
25
- });
26
- })
@@ -1,13 +0,0 @@
1
- // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the rails generate channel command.
3
- //
4
- //= require action_cable
5
- //= require_self
6
- //= require_tree ./channels
7
-
8
- (function() {
9
- this.App || (this.App = {});
10
-
11
- App.cable = ActionCable.createConsumer();
12
-
13
- }).call(this);
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the Addresses controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,15 +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 other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,89 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- margin: 33px;
8
- }
9
-
10
- p, ol, ul, td {
11
- font-family: verdana, arial, helvetica, sans-serif;
12
- font-size: 13px;
13
- line-height: 18px;
14
- margin: 33px;
15
- }
16
-
17
- pre {
18
- background-color: #eee;
19
- padding: 10px;
20
- font-size: 11px;
21
- }
22
-
23
- a {
24
- color: #000;
25
-
26
- &:visited {
27
- color: #666;
28
- }
29
-
30
- &:hover {
31
- color: #fff;
32
- background-color: #000;
33
- }
34
- }
35
-
36
- th {
37
- padding-bottom: 5px;
38
- }
39
-
40
- td {
41
- padding-bottom: 7px;
42
- padding-left: 5px;
43
- padding-right: 5px;
44
- }
45
-
46
- div {
47
- &.field, &.actions {
48
- margin-bottom: 10px;
49
- }
50
- }
51
-
52
- #notice {
53
- color: green;
54
- }
55
-
56
- .field_with_errors {
57
- padding: 2px;
58
- background-color: red;
59
- display: table;
60
- }
61
-
62
- #error_explanation {
63
- width: 450px;
64
- border: 2px solid red;
65
- padding: 7px;
66
- padding-bottom: 0;
67
- margin-bottom: 20px;
68
- background-color: #f0f0f0;
69
-
70
- h2 {
71
- text-align: left;
72
- font-weight: bold;
73
- padding: 5px 5px 5px 15px;
74
- font-size: 12px;
75
- margin: -7px;
76
- margin-bottom: 0;
77
- background-color: #c00;
78
- color: #fff;
79
- }
80
-
81
- ul li {
82
- font-size: 12px;
83
- list-style: square;
84
- }
85
- }
86
-
87
- label {
88
- display: block;
89
- }
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,74 +0,0 @@
1
- class AddressesController < ApplicationController
2
- before_action :set_address, only: [:show, :edit, :update, :destroy]
3
-
4
- # GET /addresses
5
- # GET /addresses.json
6
- def index
7
- @addresses = Address.all
8
- end
9
-
10
- # GET /addresses/1
11
- # GET /addresses/1.json
12
- def show
13
- end
14
-
15
- # GET /addresses/new
16
- def new
17
- @address = Address.new
18
- end
19
-
20
- # GET /addresses/1/edit
21
- def edit
22
- end
23
-
24
- # POST /addresses
25
- # POST /addresses.json
26
- def create
27
- @address = Address.new(address_params)
28
-
29
- respond_to do |format|
30
- if @address.save
31
- format.html { redirect_to @address, notice: 'Address was successfully created.' }
32
- format.json { render :show, status: :created, location: @address }
33
- else
34
- format.html { render :new }
35
- format.json { render json: @address.errors, status: :unprocessable_entity }
36
- end
37
- end
38
- end
39
-
40
- # PATCH/PUT /addresses/1
41
- # PATCH/PUT /addresses/1.json
42
- def update
43
- respond_to do |format|
44
- if @address.update(address_params)
45
- format.html { redirect_to @address, notice: 'Address was successfully updated.' }
46
- format.json { render :show, status: :ok, location: @address }
47
- else
48
- format.html { render :edit }
49
- format.json { render json: @address.errors, status: :unprocessable_entity }
50
- end
51
- end
52
- end
53
-
54
- # DELETE /addresses/1
55
- # DELETE /addresses/1.json
56
- def destroy
57
- @address.destroy
58
- respond_to do |format|
59
- format.html { redirect_to addresses_url, notice: 'Address was successfully destroyed.' }
60
- format.json { head :no_content }
61
- end
62
- end
63
-
64
- private
65
- # Use callbacks to share common setup or constraints between actions.
66
- def set_address
67
- @address = Address.find(params[:id])
68
- end
69
-
70
- # Never trust parameters from the scary internet, only allow the white list through.
71
- def address_params
72
- params.require(:address).permit(:zipcode, :neighborhood, :city, :state)
73
- end
74
- end
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery with: :exception
3
- end
File without changes
@@ -1,2 +0,0 @@
1
- module AddressesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- class ApplicationJob < ActiveJob::Base
2
- end
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
4
- end
@@ -1,2 +0,0 @@
1
- class Address < ApplicationRecord
2
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
File without changes
@@ -1,2 +0,0 @@
1
- json.extract! address, :id, :zipcode, :neighborhood, :city, :state, :created_at, :updated_at
2
- json.url address_url(address, format: :json)
@@ -1,18 +0,0 @@
1
- <h2>Simple Form</h2>
2
-
3
- <%= simple_form_for(@address) do |f| %>
4
- <%= f.error_notification %>
5
-
6
- <div class="form-inputs">
7
- <%= f.input :zipcode, as: :zipcode %>
8
- <small style="display: none;" id="error">Error - Invalid zipcode</small>
9
- <%= f.input :street, as: :street %>
10
- <%= f.input :neighborhood, as: :neighborhood %>
11
- <%= f.input :city, as: :city %>
12
- <%= f.input :state, as: :state %>
13
- </div>
14
-
15
- <div class="form-actions">
16
- <%= f.button :submit %>
17
- </div>
18
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing Address</h1>
2
-
3
- <%= render 'form', address: @address %>
4
-
5
- <%= link_to 'Show', @address %> |
6
- <%= link_to 'Back', addresses_path %>
@@ -1,33 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <h1>Addresses</h1>
4
-
5
- <table>
6
- <thead>
7
- <tr>
8
- <th>Zipcode</th>
9
- <th>Neighborhood</th>
10
- <th>City</th>
11
- <th>State</th>
12
- <th colspan="3"></th>
13
- </tr>
14
- </thead>
15
-
16
- <tbody>
17
- <% @addresses.each do |address| %>
18
- <tr>
19
- <td><%= address.zipcode %></td>
20
- <td><%= address.neighborhood %></td>
21
- <td><%= address.city %></td>
22
- <td><%= address.state %></td>
23
- <td><%= link_to 'Show', address %></td>
24
- <td><%= link_to 'Edit', edit_address_path(address) %></td>
25
- <td><%= link_to 'Destroy', address, method: :delete, data: { confirm: 'Are you sure?' } %></td>
26
- </tr>
27
- <% end %>
28
- </tbody>
29
- </table>
30
-
31
- <br>
32
-
33
- <%= link_to 'New Address', new_address_path %>
@@ -1 +0,0 @@
1
- json.array! @addresses, partial: 'addresses/address', as: :address
@@ -1,5 +0,0 @@
1
- <h1>New Address</h1>
2
-
3
- <%= render 'form', address: @address %>
4
-
5
- <%= link_to 'Back', addresses_path %>
@@ -1,24 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <strong>Zipcode:</strong>
5
- <%= @address.zipcode %>
6
- </p>
7
-
8
- <p>
9
- <strong>Neighborhood:</strong>
10
- <%= @address.neighborhood %>
11
- </p>
12
-
13
- <p>
14
- <strong>City:</strong>
15
- <%= @address.city %>
16
- </p>
17
-
18
- <p>
19
- <strong>State:</strong>
20
- <%= @address.state %>
21
- </p>
22
-
23
- <%= link_to 'Edit', edit_address_path(@address) %> |
24
- <%= link_to 'Back', addresses_path %>
@@ -1 +0,0 @@
1
- json.partial! "addresses/address", address: @address
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Example</title>
5
- <%= csrf_meta_tags %>
6
-
7
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
- <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
- </head>
10
-
11
- <body>
12
- <%= yield %>
13
- </body>
14
- </html>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>