This ractive extension could be of interest to you IMHO: http://ractive-require.codecorico.com/
2015-10-22 10:11 GMT+02:00 p a <p...@cancamusa.net>: > Two more comments: > > - I don't intend to push all logic to the server, but only the "view" part > in web2py. My long term goal is to have a working API, and many ractive > components that can be combined in different ways, and allow to show data > and/or interact with it independently. Then a person joining the team will > have an easier job if she wants to work only on the front, in javascript, > or only on the server, in python. The work I'm doing right now is also > trying to fix all the routes that did not work well in json, for one reason > or another. Maybe it will open new chances for interoperability with other > software. Before I started to do this transformation, returning a dict with > only raw data from every controller was only a question of > discipline/aestetics, but now it's for real. > > - There's another issue that you may run into, Rod, and it's redirections. > The solution is bytesize, if you can find it. My solution was to modify > web2py.js, from: > > var redirect = xhr.getResponseHeader('web2py-redirect-location'); > > if(redirect !== null) { > window.location = redirect; > > > to: > > var redirect = xhr.getResponseHeader('web2py-redirect-location'); > > if(redirect !== null) { > YourRouter.navTo(redirect); > > > and use client_side=True on web2py so that it returns a 200 code instead > of a 303 code. That way redirections work fine with page.js. Maybe in > crossroads.js you can find other solutions, page.js seems simpler to use > but more constrained. > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.