Sha256: bbe87acb36bfa3f929f7077cfaeebd656bd74e33530b6b5aaf61454da941cb12
Contents?: true
Size: 1.02 KB
Versions: 20
Compression:
Stored size: 1.02 KB
Contents
// This object provides dynamically generated Rails routes in Javascript. // A little bit hacky, but the best solution so far. ^_^ <% self.class.send(:include, Alchemy::Engine.routes.url_helpers) %> if (typeof(Alchemy) === 'undefined') { var Alchemy = {}; } (function($) { var routes = {}; $.extend(Alchemy, routes); Alchemy.routes = { admin_picture_path: function(id) { return '<%= admin_picture_path(:id => 1) %>'.replace(/1/, id); }, admin_trash_path : function(page_id) { var url = '<%= admin_trash_path %>'; if (page_id) url += '?page_id=' + page_id; return url; }, fold_admin_element_path: function(id) { return '<%= fold_admin_element_path(:id => 1) %>'.replace(/1/, id); }, list_admin_elements_path: '<%= list_admin_elements_path %>', order_admin_contents_path: '<%= order_admin_contents_path %>', order_admin_elements_path: '<%= order_admin_elements_path %>', order_admin_pages_path: '<%= order_admin_pages_path %>', link_admin_pages_path: '<%= link_admin_pages_path %>' } })(jQuery);
Version data entries
20 entries across 20 versions & 1 rubygems