PANmedia / raptor-editor

Raptor, an HTML5 WYSIWYG content editor!
www.raptor-editor.com
GNU General Public License v3.0
533 stars 136 forks source link

saveJson and saveRest not working as per the example #178

Open rhatherall opened 9 years ago

rhatherall commented 9 years ago

Hi,

I've implemented a very basic save in both saveJson and saveRest methods but neither work as per the example.

I'm using jQuery and jQueryUI provided by the Rails 4.2 application. The 'Edit' button and menu appear and act as expected but the save request doesn't happen after dirtying the editable region and clicking save. There is no message presented when clicking save.

All of the formatting features are working as expected.

<div id="editable-region-1" class="raptor-editable" data-id="Editable-Region-1">
  Edit this region.
</div>
(function() {
  $(document).on("ready page:load", function() {
    return $('.raptor-editable').raptor({
      plugins: {
        save: {
          plugin: 'saveJson'
        }
      },
      saveJson: {
        url: 'http://localhost:3000/welcome/index',
        postName: 'resource',
        post: function() {
          return {
            id: this.raptor.getElement().data('id')
          };
        }
      }
    });
  });

}).call(this);

Am I missing something or is this not working?

Thank you,

Richard.

Petah commented 9 years ago

Hmm, not too sure whats going on here. @tristanm has implemented a Rails example backend though, have you seen it?

https://github.com/PANmedia/raptor-editor-rails