Re: [Rails] What would be the best way to handle this situation?
On Mar 20, 2013, at 11:18 AM, Ben Densmore wrote:
> Should I pull that before_save out and manually call the geolocation_address in the controller then when I hit the rescue block pass a variable so I know not to call it again when the user updates the form again, or does someone have a better solution?
If it were me, I might keep two "global" variables (*not* session variables, so stored in the db or in text files), for the timestamps of the last successful transaction with the API, and the last failed transaction with the API. Then you could look at those and decide whether or not to try using the API.
You might also consider some AJAXy voodoo to use the API *before* submitting the whole form...
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home