Therefore, I believe that there are two sides: javascript and the controller are changing.
In your controller, you need to make sure that it can return a json output (or xml or any other ajax-y output you choose):
def man
There are many ways to generate your json output, but basically you have to make sure that it is in a form that is easily consumed in a javascript view.
I am using jQuery and here is the code to make ajax call:
function foo(some_param) { $.ajax({ type: 'GET', url: "/<controller>/man?FOO=" + some_params, dataType: 'json', success: handle_success, error: handle_errors } function handle_success(data) {
You can bind the foo function to any button or by clicking as you wish.
I am not sure if this is complete enough. Let me know if you need more details, etc.
source share