2 firebug に表示されるエラー
ReferenceError: Gmaps4Rails is not defined
})(Gmaps4Rails);
ReferenceError: Gmaps4RailsGoogle is not defined
Gmaps.map = new Gmaps4RailsGoogle();
application.html.erb
<%= javascript_include_tag "gmaps4rails/gmaps4rails.googlemaps" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.base" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.bing" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.mapquest" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.openlayers" %>
<body>
<%= yield %>
<%= yield :scripts %>
</body>
propertymap.rb(モデル)
attr_accessible :title, :place, :prop_details
acts_as_gmappable #:process_geocoding => false (if custom lang and longi tudes)
def gmaps4rails_address
"#{self.title}, #{self.place}"
end
property_map_controller.rb
def index
@properties = PropertyMap.all
@json = PropertyMap.all.to_gmaps4rails
end
意見
<%= gmaps4rails(@json) %>
何も入っていない空のボックスが表示されます