Forum: Ruby on Rails ruby variable = javascript variable ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
60d38377d023a676fda76f6851585f15?d=identicon&s=25 semi (Guest)
on 2009-05-14 17:02
(Received via mailing list)
Is there a way to store the value of a js variable in a ruby variable?
The reason I ask is because, for example, when a google maps api
returns the result of let's say the location on the map, it returns it
in a js variable. I need to get the value from that variable to be
stored in a ruby variable. Is there a way in which I can do that?
Thanks.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-05-14 17:35
(Received via mailing list)
On May 14, 4:01 pm, semi <seminole10...@gmail.com> wrote:
> Is there a way to store the value of a js variable in a ruby variable?
> The reason I ask is because, for example, when a google maps api
> returns the result of let's say the location on the map, it returns it
> in a js variable. I need to get the value from that variable to be
> stored in a ruby variable. Is there a way in which I can do that?

make an http request to your app (either an ajax request or a more
traditional form submission)

Fred
60d38377d023a676fda76f6851585f15?d=identicon&s=25 semi (Guest)
on 2009-05-14 22:48
(Received via mailing list)
On May 14, 11:33 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:

> make an http request to your app (either an ajax request or a more
> traditional form submission)
>
> Fred

Thanks for the idea. I did something like this, but the page keeps
reloading over and over:

<script type="text/javascript">

   temp = "wechangedit";
   window.location.href = "http://localhost:3000/home/abc?
keyword="+temp;

</script>

<%= params[:keyword] %>
This topic is locked and can not be replied to.