Edifice

Edifice is a Javascript framework released as a rails plugin.

framework.js + associated helpers


The idea here is to communicate which view is rendering to the javascript so that we can call the correct javascript files in an automagical way.

All you need to do is add <%= edifice_meta_tags %> to your layout, in the head.

Then if you render an action, such as users/show, in the layout application, these functions[if they exist] will be fired on these js objects in the following order:

document.ready: - usersShow.onReady - layoutsApplication.onReady - [widgets are loaded] - usersShow.onWidgetReady - layoutsApplication.onWidgetReady document.load: - usersShow.onLoad - layoutsApplication.onLoad

suppose we then subsequently load users/edit via ajax, in the layout xhr. Then the following events will fire: - usersEdit.onAjaxComplete - layoutsXhr.onAjaxComplete - usersShow.onAjaxComplete - layoutsApplication.onAjaxComplete - [widgets are loaded] - usersEdit.onWidgetReady - layoutsXhr.onWidgetReady - usersShow.onWidgetReady - layoutsApplication.onWidgetReady

widgets


forms


Copyright © 2010 iCyte, released under the MIT license