Skip to content

Relative app url #42

@dostapn

Description

@dostapn

I have root url as /somepath/APP
At plugin.js we have this code:

(function($) {
  $.fn.railsSortable = function(options) {
    options = options || {};
    var settings = $.extend({}, options);
    settings.update = function(event, ui) {
      if (typeof options.update === 'function') {
        options.update(event, ui);
      }
      $.ajax({
        type: 'POST',
        url: '/sortable/reorder',
        dataType: 'json',
        contentType: 'application/json',
        data: JSON.stringify({
          rails_sortable: $(this).sortable('toArray'),
        }),
      });
    }
    this.sortable(settings);
  };
})(jQuery);

need to set variable to url or get it after app initialization.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions