I need some help,showing a map inside my rails 3.0 pages I fond cartographer in the stack overflow post Google Maps API with Rails 3.0
I followed the instructions from https://github.com/parolkar/cartographer. In addition I created a cartographer.yml and saved it in the rails_app/config directory with the Google keys for localhost:3000 and localhost:3000/gmap/
my controller looks like:
def show
@place = Place.find(params[:id])
@map = Cartographer::Gmap.new( 'map' )
@map.zoom = :bound
marker1 = Cartographer::Gmarker.new(:name=> "taj_mahal", :marker_type => "Building",
:position => [27.173006,78.042086],
:info_window_url => "/url_for_info_content")
marker2 = Cartographer::Gmarker.new(:name=> "raj_bhawan", :marker_type => "Building",
:position => [28.614309,77.201353],
:info_window_url => "/url_for_info_content")
@map.markers << marker1
@map.markers << marker2
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @place }
end
end
and I got...
undefined method `name' for :normal:Symbol
Extracted source (around line #44):
41: </p>
42:
43: <%= raw Cartographer::Header.new.to_s %>
44: <%= raw @map.to_html %>
45:
46: <%= link_to 'Edit', edit_place_path(@place) %> |
47: <%= link_to 'Back', places_path %>
Thanks ...