simple-address-generator 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,10 +18,35 @@ module SimpleAddressGenerator
|
|
18
18
|
|
19
19
|
def insert_code_application
|
20
20
|
inject_into_file "app/views/layouts/application.html.erb", after: "<%= yield %>" do
|
21
|
-
a = "\n\n
|
22
|
-
|
21
|
+
a = "\n\n attr_accessor :gmaps"
|
22
|
+
b = "\n\n geocoded_by :full_address"
|
23
|
+
c = "\n\n after_validation :geocode"
|
24
|
+
d = "\n\n acts_as_gmappable"
|
25
|
+
e = "\n\n def full_address"
|
26
|
+
f = "\n [self.address_line_1, self.address_line_2, self.city, self.state, self.country, self.postal_code].compact.join(", ")"
|
27
|
+
g = "\n end"
|
28
|
+
h = "\n\n def gmaps4rails_address"
|
29
|
+
i = "\n full_address"
|
30
|
+
j = "\n end"
|
31
|
+
k = "\n\n def gmaps4rails_marker_picture"
|
32
|
+
l = "\n {"
|
33
|
+
m = "\n 'picture' => '/assets/icon-1.png',"
|
34
|
+
n = "\n 'width => 30,"
|
35
|
+
o = "\n height' => 30,"
|
36
|
+
p = "\n 'marker_anchor => [ 5, 10],"
|
37
|
+
q = "\n 'picture' => '/assets/icon-1.png',"
|
38
|
+
r = "\n 'picture' => '/assets/icon-1.png',"
|
39
|
+
s = "\n 'picture' => '/assets/icon-1.png',"
|
40
|
+
t = "\n }"
|
41
|
+
u = "\n end"
|
42
|
+
a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def insert_to_model
|
47
|
+
inject_into_file "app/models/address.rb", after: "attr_accessible :address_line_1, :address_line_2, :category_id, :city, :country, :latitude, :longitude, :postal_code, :state, :telephone_number" do
|
48
|
+
|
23
49
|
end
|
24
|
-
|
25
50
|
end
|
26
51
|
|
27
52
|
def insert_routes
|