On Apr 14, 2007, at 8:35 PM, Kad Kerforn wrote:
> <%= link_to_remote "Localisation GoogleMap", :url =>
{:controller =>
> ''profils'', :action => ''locate_me'',
:id => current_user}, :with =>
>
"''lat=''+encodeURIComponent($F(''latitude''))
>
+''&lng=''+encodeURIComponent($F(''longitude''))",
> :method => :get %>
>
> where latitude and longitude are hidden fields in my form.
>
> but I must use a link_to (to display the map), and I don''t know
how to
> rewrite that
>
> <%= link_to "Localisation GoogleMap", :controller =>
> ''profils'', :action
> => ''locate_me'', :id => current_user, :lat =>
???, , :lng => ???
This a possible approach:
<%= link_to(
name,
options,
:onclick => "this.href += ''?lat='' +
encodeURIComponent($F
(''latitude''))"
)
%>
-- fxn
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---