Ajax calls using jQuery in Ruby on Rails
jQuery is the hot javascript library and it is small and it is cooler than Prototype, the default library that comes with Ruby on Rails. Ergo I plugged it in and pulled out everything else. The ajax calls are very simple and look like this:
$.post("function_name",{ key:value } ,function(data)
{
// do stuff with data
});
The problem is that you will start seeing 'ActionController::InvalidAuthenticityToken' and your ajax calls will fail.
-
stJhimy
Justin Ball is a software consultant and entrepreneur with a passion for Ruby. He evolved from a C++ and .Net monkey into a python programmer and finally found Ruby. In the rare moments when he isn't writing code, talking about code or measuring his code productivity in profanity per hour, you can find him on his bike in the mountains or on the roads surrounding Cache Valley. 









