Neat trick if you want to use Ajax on a checkbox and don't want to create a separate function for onclick.
Neat trick if you want to use Ajax on a checkbox and don't want to create a separate function for onclick.
Do you need a delayed_job job to happen at certain times or intervals?
This one is easy and I use it quite often - particularly to scrape data at certain times during the day, and generate nightly statistics and reports.
Why would I use delayed_job to handle recurring jobs over rake task?
Every time a rake task is issued, a new rails instance is spawned which takes time and memory to start and run. If a delayed_job daemon is already running, using that will save both. In my opinion, running a rake task that uses the rails environment is usually very costly in production and should be avoided if possible.
Update: I'm currently working this into a gem. Feel free to watch/use/contribute on github: http://github.com/aaronvb/fb_js_connect
I wrote this class to verify(using Facebook's cookie verification article) and parse the Facebook Javascript Connect cookie.
This can definitely work without Ruby on Rails, but you may need to change a few things.
Reference: Facebook Connect Javascript SDK http://developers.facebook.com/docs/reference/javascript/
To use this in Ruby on Rails, save this file into your RAILS_ROOT/lib folder. If you alter or use this code please contribute back!