Is it possible to do AJAX calls in a liquid template?
- by Brian Armstrong
I'm looking at the liquid templating language for Rails apps:
http://wiki.github.com/tobi/liquid/
I'd like my users to also be able to make AJAX calls (just like the ones in rails for periodically_call_remote, observe_field, etc). Is this possible?
Assuming the rails helpers can be added as filters, how will the user be able to modify what gets returned by the AJAX call? They cannot modify an rjs file on the server or anything like that. I suppose the AJAX call could return JSON (instead of rendered html) and then the javascript could use that to render something. But I'm having a little trouble envisioning how it would work exactly.
If anyone can point me to an example of this or clarify it'd be much appreciated. Thanks!