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.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/lib/autocomplete_zipcode/version.rb +1 -1
- data/vendor/assets/javascripts/autocomplete_zipcode.js +1 -1
- metadata +2 -99
- data/example/.gitignore +0 -21
- data/example/Gemfile +0 -55
- data/example/Gemfile.lock +0 -184
- data/example/README.md +0 -24
- data/example/Rakefile +0 -6
- data/example/app/assets/config/manifest.js +0 -3
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/javascripts/addresses.coffee +0 -3
- data/example/app/assets/javascripts/application.js +0 -26
- data/example/app/assets/javascripts/cable.js +0 -13
- data/example/app/assets/javascripts/channels/.keep +0 -0
- data/example/app/assets/stylesheets/addresses.scss +0 -3
- data/example/app/assets/stylesheets/application.css +0 -15
- data/example/app/assets/stylesheets/scaffolds.scss +0 -89
- data/example/app/channels/application_cable/channel.rb +0 -4
- data/example/app/channels/application_cable/connection.rb +0 -4
- data/example/app/controllers/addresses_controller.rb +0 -74
- data/example/app/controllers/application_controller.rb +0 -3
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/helpers/addresses_helper.rb +0 -2
- data/example/app/helpers/application_helper.rb +0 -2
- data/example/app/jobs/application_job.rb +0 -2
- data/example/app/mailers/application_mailer.rb +0 -4
- data/example/app/models/address.rb +0 -2
- data/example/app/models/application_record.rb +0 -3
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/views/addresses/_address.json.jbuilder +0 -2
- data/example/app/views/addresses/_form.html.erb +0 -18
- data/example/app/views/addresses/edit.html.erb +0 -6
- data/example/app/views/addresses/index.html.erb +0 -33
- data/example/app/views/addresses/index.json.jbuilder +0 -1
- data/example/app/views/addresses/new.html.erb +0 -5
- data/example/app/views/addresses/show.html.erb +0 -24
- data/example/app/views/addresses/show.json.jbuilder +0 -1
- data/example/app/views/layouts/application.html.erb +0 -14
- data/example/app/views/layouts/mailer.html.erb +0 -13
- data/example/app/views/layouts/mailer.text.erb +0 -1
- data/example/bin/bundle +0 -3
- data/example/bin/rails +0 -9
- data/example/bin/rake +0 -9
- data/example/bin/setup +0 -34
- data/example/bin/spring +0 -17
- data/example/bin/update +0 -29
- data/example/config.ru +0 -5
- data/example/config/application.rb +0 -15
- data/example/config/boot.rb +0 -3
- data/example/config/cable.yml +0 -9
- data/example/config/database.yml +0 -25
- data/example/config/environment.rb +0 -5
- data/example/config/environments/development.rb +0 -54
- data/example/config/environments/production.rb +0 -86
- data/example/config/environments/test.rb +0 -42
- data/example/config/initializers/application_controller_renderer.rb +0 -6
- data/example/config/initializers/assets.rb +0 -11
- data/example/config/initializers/backtrace_silencers.rb +0 -7
- data/example/config/initializers/cookies_serializer.rb +0 -5
- data/example/config/initializers/filter_parameter_logging.rb +0 -4
- data/example/config/initializers/inflections.rb +0 -16
- data/example/config/initializers/mime_types.rb +0 -4
- data/example/config/initializers/new_framework_defaults.rb +0 -24
- data/example/config/initializers/session_store.rb +0 -3
- data/example/config/initializers/simple_form.rb +0 -169
- data/example/config/initializers/wrap_parameters.rb +0 -14
- data/example/config/locales/en.yml +0 -23
- data/example/config/locales/simple_form.en.yml +0 -31
- data/example/config/puma.rb +0 -47
- data/example/config/routes.rb +0 -4
- data/example/config/secrets.yml +0 -22
- data/example/config/spring.rb +0 -6
- data/example/db/migrate/20170425234824_create_addresses.rb +0 -13
- data/example/db/schema.rb +0 -25
- data/example/db/seeds.rb +0 -7
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/lib/templates/erb/scaffold/_form.html.erb +0 -13
- data/example/log/.keep +0 -0
- data/example/public/404.html +0 -67
- data/example/public/422.html +0 -67
- data/example/public/500.html +0 -66
- data/example/public/apple-touch-icon-precomposed.png +0 -0
- data/example/public/apple-touch-icon.png +0 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +0 -5
- data/example/test/controllers/.keep +0 -0
- data/example/test/controllers/addresses_controller_test.rb +0 -48
- data/example/test/fixtures/.keep +0 -0
- data/example/test/fixtures/addresses.yml +0 -13
- data/example/test/fixtures/files/.keep +0 -0
- data/example/test/helpers/.keep +0 -0
- data/example/test/integration/.keep +0 -0
- data/example/test/mailers/.keep +0 -0
- data/example/test/models/.keep +0 -0
- data/example/test/models/address_test.rb +0 -7
- data/example/test/test_helper.rb +0 -10
- data/example/tmp/.keep +0 -0
- data/example/vendor/assets/javascripts/.keep +0 -0
- data/example/vendor/assets/stylesheets/.keep +0 -0
data/example/README.md
DELETED
|
@@ -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
|
-
* ...
|
data/example/Rakefile
DELETED
|
File without changes
|
|
@@ -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);
|
|
File without changes
|
|
@@ -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,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
|
|
File without changes
|
|
File without changes
|
|
@@ -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,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,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>
|