//http://stackoverflow.com/questions/6167805/using-rails-3-1-where-do-you-put-your-page-specific-javascript-code POKE = { blank: function(o) { return typeof o === "undefined" || o === null; }, get_or_create: function(namespace_string) { var current_namepace = window; $.each(namespace_string.split('.'), function(index, level) { if (POKE.blank(current_namepace[level])) current_namepace[level] = {}; current_namepace = current_namepace[level]; }); return current_namepace; }, define: function(namespace_string, definition) { var found_namespace = POKE.get_or_create(namespace_string); return $.extend(found_namespace, definition); }, get_action_namespace: function(controller, format) { var levels = controller.split('/'); levels.push(format); var current_namespace = APP; for (var i=0;i