Re:Renee, the friendly rack-based framework
by nakajima on Saturday October 15, 2011 @10:55PM
(#3116392)
I wrote something like this a while back: https://github.com/nakajima/sinatras-hat It's no longer maintained, but it was fun to see how many assumptions I could jam into one framework.
Re:Renee, the friendly rack-based framework
by lobster_johnson on Sunday October 16, 2011 @05:55PM
(#3118415)
That's pretty cool!
Something like this:
That's it. This makes some assumptions:* That /blog maps to a class Blog which it can load and save. * That you either use "fat models" (with callbacks that munge data and perform actions when data changes) or external observers (like ActiveRecord's observers). * That the model supports all four CRUD actions.
When you want additional verbs:
Or object-specific ones: In fact, aside from extra verbs, you could get away with no code at all, since you could introspect the database layer to discover which classes are mappable.My app is a JavaScript-based single-page HTML5 web application using Backbone, so there is almost no server-side frontend code, meaning my app is basically a server-side database anyway.