0 Replies - 299 Views - Last Post: 02 April 2011 - 03:48 PM Rate Topic: -----

#1 nimajneb  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 116
  • Joined: 04-August 10

Rails: Help POSTing a javascript var

Posted 02 April 2011 - 03:48 PM

So it seems like this is a common problem in the rails community, but I still can't seem to get this to pass. I have a javascript var that I need to be stored in my database.

Specifics: I'm using geolocation with HTML5/javascript and the outcome from the browser gives me a stored var, latitude. I can output the value to the screen via:
%= content_tag(:span, "", :id => "latitude") %>


Now, I'm trying to submit this value and have it store in my db. I've tried using hidden_field to no avail. My next thought is using remote_funtion:

<% remote_function(:update => "latlong", :url => {:action => 'new'}, :with => "latitude" ) %>


Thoughts? Suggestions? Gracias.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1