Hello everybody, I''m working with Google Maps and i want to display a map for an event that i have in my aplicaction. When I clik on the link to view the map the bwroser show me the next fail: NoMethodError in Conclave/events#map Showing vendor/plugins/tog_conclave/app/views/conclave/events/ map.html.erb where line #5 raised: undefined method `to_html'' for nil:NilClass Extracted source (around line #5): 2: <%= GMap.header %> 3: </head> 4: <body> 5: <%= @map.to_html %> 6: <%= @map.div(:width => 550, :height => 350) %> 7: </body> This link appear in anothe view like this: <li>Dirección: <%= link_to @event.venue, map_conclave_event_path(@event), :popup => [@event.venue, ''width=600,height=400''] and in the controller i have the next code: def show generate_map end def map generate_map end private def generate_map return if !@event.venue_address || @event.venue_address == '''' loc = gg.locate @event.venue_address @map = GMap.new("map_div_id") @map.control_init(:large_map => true, :map_type => true) @map.center_zoom_init([loc.latitude, loc.longitude],14) marker = GMarker.new([loc.latitude,loc.longitude], :title => @event.title, :info_window => (@event.venue_address ? loc.address : "#{loc.address} *specified address unknown")) @map.overlay_init(marker) rescue @map = nil end So i want to know what is the problem? Can anyone help me? Thanks for you help. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 November 2010 10:49, h0bit <jsantana.gcc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello everybody, > > I''m working with Google Maps and i want to display a map for an event > that i have in my aplicaction. > > When I clik on the link to view the map the bwroser show me the next > fail: > > NoMethodError in Conclave/events#map > > Showing vendor/plugins/tog_conclave/app/views/conclave/events/ > map.html.erb where line #5 raised: > > undefined method `to_html'' for nil:NilClass > > Extracted source (around line #5): > > 2: <%= GMap.header %> > 3: </head> > 4: <body> > 5: <%= @map.to_html %>The error is saying that @map is nil> 6: <%= @map.div(:width => 550, :height => 350) %> > 7: </body> > > > This link appear in anothe view like this: > > <li>Dirección: <%= link_to @event.venue, > map_conclave_event_path(@event), :popup => [@event.venue, > ''width=600,height=400''] > > and in the controller i have the next code: > > def show > generate_map > end > > def map > generate_map > end > > private > > def generate_map > return if !@event.venue_address || @event.venue_address == '''' > loc = gg.locate @event.venue_address > @map = GMap.new("map_div_id") > -P2fSN3m5QBxjiozNKWjDrg@public.gmane.org_init(:large_map => true, :map_type => true) > -Navy0iaS+xupuJRAN1am9g@public.gmane.org_zoom_init([loc.latitude, loc.longitude],14) > marker = GMarker.new([loc.latitude,loc.longitude], > :title => @event.title, > :info_window => (@event.venue_address ? loc.address : > "#{loc.address} *specified address unknown")) > -mDGcsIj0EBRcKHiaeZqq9g@public.gmane.org_init(marker) > > rescue > @map = nilCould it be doing this? You could use ruby-debug to break into your app and see what is happening. Have a look at the Rails Guide on Debugging. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What are you using to work with google maps? Did you tried go_maps? https://github.com/gonow/go_maps On 3 November 2010 08:49, h0bit <jsantana.gcc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello everybody, > > I''m working with Google Maps and i want to display a map for an event > that i have in my aplicaction. > > When I clik on the link to view the map the bwroser show me the next > fail: > > NoMethodError in Conclave/events#map > > Showing vendor/plugins/tog_conclave/app/views/conclave/events/ > map.html.erb where line #5 raised: > > undefined method `to_html'' for nil:NilClass > > Extracted source (around line #5): > > 2: <%= GMap.header %> > 3: </head> > 4: <body> > 5: <%= @map.to_html %> > 6: <%= @map.div(:width => 550, :height => 350) %> > 7: </body> > > > This link appear in anothe view like this: > > <li>Dirección: <%= link_to @event.venue, > map_conclave_event_path(@event), :popup => [@event.venue, > ''width=600,height=400''] > > and in the controller i have the next code: > > def show > generate_map > end > > def map > generate_map > end > > private > > def generate_map > return if !@event.venue_address || @event.venue_address == '''' > loc = gg.locate @event.venue_address > @map = GMap.new("map_div_id") > @map.control_init(:large_map => true, :map_type => true) > @map.center_zoom_init([loc.latitude, loc.longitude],14) > marker = GMarker.new([loc.latitude,loc.longitude], > :title => @event.title, > :info_window => (@event.venue_address ? loc.address : > "#{loc.address} *specified address unknown")) > @map.overlay_init(marker) > > rescue > @map = nil > end > > So i want to know what is the problem? > > Can anyone help me? > > Thanks for you help. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- from Brazil, Raul Souza Lima Vegetarian, geek, born in São Paulo - Brazil. http://webxperience.com.br/ http://raulsouzalima.com http://www.linkedin.com/in/raulsouzalima Please don''t print this e-mail Evite imprimir este e-mail -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No i''m using google-geocode On 3 nov, 12:47, Raul Souza Lima <raulsouzal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What are you using to work with google maps? > > Did you tried go_maps? > > https://github.com/gonow/go_maps > > On 3 November 2010 08:49, h0bit <jsantana....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello everybody, > > > I''m working with Google Maps and i want to display a map for an event > > that i have in my aplicaction. > > > When I clik on the link to view the map the bwroser show me the next > > fail: > > > NoMethodError in Conclave/events#map > > > Showing vendor/plugins/tog_conclave/app/views/conclave/events/ > > map.html.erb where line #5 raised: > > > undefined method `to_html'' for nil:NilClass > > > Extracted source (around line #5): > > > 2: <%= GMap.header %> > > 3: </head> > > 4: <body> > > 5: <%= @map.to_html %> > > 6: <%= @map.div(:width => 550, :height => 350) %> > > 7: </body> > > > This link appear in anothe view like this: > > > <li>Dirección: <%= link_to @event.venue, > > map_conclave_event_path(@event), :popup => [@event.venue, > > ''width=600,height=400''] > > > and in the controller i have the next code: > > > def show > > generate_map > > end > > > def map > > generate_map > > end > > > private > > > def generate_map > > return if !...@event.venue_address || @event.venue_address == '''' > > loc = gg.locate @event.venue_address > > @map = GMap.new("map_div_id") > > -P2fSN3m5QBxjiozNKWjDrg@public.gmane.org_init(:large_map => true, :map_type => true) > > -Navy0iaS+xupuJRAN1am9g@public.gmane.org_zoom_init([loc.latitude, loc.longitude],14) > > marker = GMarker.new([loc.latitude,loc.longitude], > > :title => @event.title, > > :info_window => (@event.venue_address ? loc.address : > > "#{loc.address} *specified address unknown")) > > -mDGcsIj0EBRcKHiaeZqq9g@public.gmane.org_init(marker) > > > rescue > > @map = nil > > end > > > So i want to know what is the problem? > > > Can anyone help me? > > > Thanks for you help. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > from Brazil, Raul Souza Lima > Vegetarian, geek, born in São Paulo - Brazil.http://webxperience.com.br/http://raulsouzalima.comhttp://www.linkedin.com/in/raulsouzalima > > Please don''t print this e-mail > Evite imprimir este e-mail-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No i''m using googl-geocode and ym4r-gm On 3 nov, 12:47, Raul Souza Lima <raulsouzal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What are you using to work with google maps? > > Did you tried go_maps? > > https://github.com/gonow/go_maps > > On 3 November 2010 08:49, h0bit <jsantana....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello everybody, > > > I''m working with Google Maps and i want to display a map for an event > > that i have in my aplicaction. > > > When I clik on the link to view the map the bwroser show me the next > > fail: > > > NoMethodError in Conclave/events#map > > > Showing vendor/plugins/tog_conclave/app/views/conclave/events/ > > map.html.erb where line #5 raised: > > > undefined method `to_html'' for nil:NilClass > > > Extracted source (around line #5): > > > 2: <%= GMap.header %> > > 3: </head> > > 4: <body> > > 5: <%= @map.to_html %> > > 6: <%= @map.div(:width => 550, :height => 350) %> > > 7: </body> > > > This link appear in anothe view like this: > > > <li>Dirección: <%= link_to @event.venue, > > map_conclave_event_path(@event), :popup => [@event.venue, > > ''width=600,height=400''] > > > and in the controller i have the next code: > > > def show > > generate_map > > end > > > def map > > generate_map > > end > > > private > > > def generate_map > > return if !...@event.venue_address || @event.venue_address == '''' > > loc = gg.locate @event.venue_address > > @map = GMap.new("map_div_id") > > -P2fSN3m5QBxjiozNKWjDrg@public.gmane.org_init(:large_map => true, :map_type => true) > > -Navy0iaS+xupuJRAN1am9g@public.gmane.org_zoom_init([loc.latitude, loc.longitude],14) > > marker = GMarker.new([loc.latitude,loc.longitude], > > :title => @event.title, > > :info_window => (@event.venue_address ? loc.address : > > "#{loc.address} *specified address unknown")) > > -mDGcsIj0EBRcKHiaeZqq9g@public.gmane.org_init(marker) > > > rescue > > @map = nil > > end > > > So i want to know what is the problem? > > > Can anyone help me? > > > Thanks for you help. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > from Brazil, Raul Souza Lima > Vegetarian, geek, born in São Paulo - Brazil.http://webxperience.com.br/http://raulsouzalima.comhttp://www.linkedin.com/in/raulsouzalima > > Please don''t print this e-mail > Evite imprimir este e-mail-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.