zappa icon indicating copy to clipboard operation
zappa copied to clipboard

Make CoffeeKup views available in client side scripts

Open jacobrask opened this issue 13 years ago • 2 comments

It would be nice to have your CoffeKup views (or at least CoffeeKup in some easy way) available in client side scripts.

My first obvious idea is to auto-compile all views to a template.js file, and serve CoffeeKup as /zappa/coffeekup.js, but maybe it can be done in better way.

As far as I can tell there's currently no easy/shortcut way to use client side CoffeeKup templates in Zappa.

jacobrask avatar Sep 23 '11 09:09 jacobrask

Right. Let me give an example why this would be a Good Thing. I have a microblogging app. Posts are rendered at two times. The server renders posts in a http handler. The client renders posts in a socket handler (providing real-time updates). Presently the server calls a @view—a CoffeeKup template—with partial. Whereas the client socket handler renders posts with jQuery.

In accordance with Don't Repeat Yourself I want to use same code to render the posts on the server and client. Zappa is probably the first framework where this could be possible.

hickford avatar Nov 02 '11 23:11 hickford

+1 this would be an awesome feature

Darcbar avatar Mar 25 '13 16:03 Darcbar