hey everyone
I'm trying to implement a google map in my application using the ym4r
framework.
Accessing the action directly using the url /controller/action works
fine.
However, when i use link_to_remote or render_component to display the
action that has the map, it just renders a blank div.
Does anyone have any idea on what could be happening or how should i
load it properly?
Here's how i'm declaring the link:
<%= link_to_remote 'Mapa',
:update => 'main-window',
:method => 'get',
:url => { :controller => 'country', :action => 'index'} %>
Thanks in advance,
Ricardo Silveira Cabral
Hi Ricardo,
I don't think the problem is in your link_to_remote, if you have the
id 'main-window' and is updating it with a 'blank div' that link is
doing something. Are you sure you the output you are getting from
country/index is what you want?
Can you give us the country/index action code and the view code too?
My advice would be: try it without ajax and do some tests, after you
are sure of what is it doing, add ajax just to: "make it suck less".
Suerte!
What do you mean by conflicts? i have
<%= GMap.header(:with_vml => false) %>
declared on both the head of the layout and in country/index.rhtml,
but i've tried every combination of header declarations with these two
files to no avail.
I've uploaded my latest code to the site (with it's respective google
maps api key :)) to
http://sattagis1.dza.fc.ul.pt:3000/
if you want to take a look. The problematic link_to_remote to country/
index is the word 'Mapa' in the second menu.
Thanks,
Ricardo Silveira Cabral
For everyone trying the same thing:
Guilhem Vellut suggested changing
<%= @map.to_html %>
to
<%= @map.to_html :no_load => true %>
which fixed the situation.
Ricardo