Is it possible to do AJAX calls in a liquid template?

Posted by Brian Armstrong on Stack Overflow See other posts from Stack Overflow or by Brian Armstrong
Published on 2010-03-23T06:39:18Z Indexed on 2010/03/23 6:43 UTC
Read the original article Hit count: 384

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!

© Stack Overflow or respective owner

Related posts about liquid-layout

Related posts about ruby-on-rails