diff --git a/vendor/assets/javascripts/plugin.js b/vendor/assets/javascripts/plugin.js index 9287893..e1be634 100644 --- a/vendor/assets/javascripts/plugin.js +++ b/vendor/assets/javascripts/plugin.js @@ -3,6 +3,8 @@ $.fn.railsSortable = function(options) { options = options || {}; var settings = $.extend({}, options); + + settings.baseUrl = settings.baseUrl || ''; settings.update = function(event, ui) { if (typeof options.update === 'function') { @@ -11,7 +13,7 @@ $.ajax({ type: 'POST', - url: '/sortable/reorder', + url: settings.baseUrl + '/sortable/reorder', dataType: 'json', contentType: 'application/json', data: JSON.stringify({ @@ -22,4 +24,4 @@ this.sortable(settings); }; -})(jQuery); \ No newline at end of file +})(jQuery);