Hi,
I have a resource that can take latitue and longitude. I have defined
those in the DB as:
t.decimal :lat, :precision => 15, :scale => 10
t.decimal :lng, :precision => 15, :scale => 10
I have set the route so I can pass those in a restful way:
map.nearby ''/messages/nearby/:lat/:lng/:range/'',
:controller => ''nearbies'',
:action => ''index'',
:conditions => {:method => :get}
So I can pass a URL like:
http://127.0.0.1.:3000/messages/nearby/0,4/1,3/73
However the 0,4 and 1,3 are strings and when they are used for latitude
and longitude they become 0.0 and 1.0
I see two options:
1- Convert 0,4 to 0.4 (I need decimal, :precision => 15, :scale => 10)
2- Allow decimals in the URL (..messages/nearby/0.4/1.3/73)
Is option #2 possible?
Any hints to realize any of them?
I have not succeeded converting the string...
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---