gmaps4rails 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -2
- data/config/routes.rb +7 -6
- data/lib/engine.rb +30 -11
- data/lib/gmaps4rails.rb +2 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
== Gmaps4rails
|
2
2
|
|
3
|
-
|
3
|
+
GEM NOT READY YET.
|
4
4
|
It's still in heavy dev and I have a bug with engines (I can't find enough doc on this topic). See http://github.com/krschacht/rails_3_engine_demo/issues/issue/3/ for the bug report.
|
5
5
|
|
6
|
+
Gmaps4rails is developed to simply create a map with model instances (say Users).
|
6
7
|
|
7
8
|
|
8
9
|
== Installation
|
@@ -36,10 +37,11 @@ It's still in heavy dev and I have a bug with engines (I can't find enough doc o
|
|
36
37
|
t.boolean "gmaps"
|
37
38
|
|
38
39
|
=== In your view
|
39
|
-
<%= render :partial => 'gmaps4rails/gmaps4rails', :locals => { :model => "User"} %>
|
40
|
+
<%= render :partial => 'gmaps4rails/gmaps4rails', :locals => { :model => "User"} %>
|
40
41
|
|
41
42
|
== Todo
|
42
43
|
Many customization will be available (at least, those already developed but not written here):
|
44
|
+
- Marker Cluster available
|
43
45
|
- integration of scopes to decide what you want to display precisely
|
44
46
|
- distance filter
|
45
47
|
|
data/config/routes.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
Rails.application.routes.draw do |map|
|
1
|
+
#Rails.application.routes.draw do |map|
|
2
|
+
Rails.application.routes.draw do
|
2
3
|
|
3
|
-
mount_at = Gmaps4rails::Engine.config.mount_at
|
4
|
+
#mount_at = Gmaps4rails::Engine.config.mount_at
|
4
5
|
|
5
|
-
match mount_at => 'gmaps4rails/gmaps#index'
|
6
|
+
#match mount_at => 'gmaps4rails/gmaps#index'
|
6
7
|
|
7
|
-
|
8
|
-
:controller => "gmaps4rails/gmaps"
|
9
|
-
|
8
|
+
resources :gmaps, :only => [ :index ],
|
9
|
+
:controller => "gmaps4rails/gmaps"#,
|
10
|
+
# :path_prefix => mount_at
|
10
11
|
#:name_prefix => "gmaps4rails_"
|
11
12
|
|
12
13
|
end
|
data/lib/engine.rb
CHANGED
@@ -2,23 +2,42 @@ require 'rails'
|
|
2
2
|
require 'action_controller'
|
3
3
|
require 'application_helper'
|
4
4
|
require 'acts_as_gmappable/base'
|
5
|
-
require 'gmaps4rails'
|
5
|
+
#require 'gmaps4rails'
|
6
|
+
|
7
|
+
# module Gmaps4rails
|
8
|
+
# class Engine < Rails::Engine
|
9
|
+
# # Config defaults
|
10
|
+
# config.widget_factory_name = "gmaps4rails"
|
11
|
+
# config.mount_at = '/'
|
12
|
+
#
|
13
|
+
# # Check the gem config
|
14
|
+
# initializer "check config" do |app|
|
15
|
+
# # make sure mount_at ends with trailing slash
|
16
|
+
# config.mount_at += '/' unless config.mount_at.last == '/'
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# initializer "static assets" do |app|
|
20
|
+
# app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# end
|
24
|
+
# end
|
6
25
|
|
7
26
|
module Gmaps4rails
|
8
27
|
class Engine < Rails::Engine
|
9
|
-
|
10
|
-
config.
|
11
|
-
config.mount_at = '/'
|
12
|
-
|
13
|
-
# Check the gem config
|
14
|
-
initializer "check config" do |app|
|
15
|
-
# make sure mount_at ends with trailing slash
|
16
|
-
config.mount_at += '/' unless config.mount_at.last == '/'
|
17
|
-
end
|
28
|
+
|
29
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
18
30
|
|
19
31
|
initializer "static assets" do |app|
|
20
32
|
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
21
33
|
end
|
22
|
-
|
34
|
+
|
35
|
+
def self.activate
|
36
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*.rb")) do |c|
|
37
|
+
Rails.env.production? ? require(c) : load(c)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
config.to_prepare &method(:activate).to_proc
|
23
42
|
end
|
24
43
|
end
|
data/lib/gmaps4rails.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps4rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13
|
10
|
+
version: 0.0.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Roth
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-21 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|