Sha256: a9ecfbce9fe327fba54217fcb376b5e25eb5514e43bb9609a48cac665909be1a
Contents?: true
Size: 1.07 KB
Versions: 46
Compression:
Stored size: 1.07 KB
Contents
// This object provides dynamically generated Rails routes in Javascript. // A little bit hacky, but the best solution so far. ^_^ <% self.class.instance_eval { 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
46 entries across 46 versions & 1 rubygems