Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saveJson and saveRest not working as per the example #178

Open
rhatherall opened this issue Jul 7, 2015 · 1 comment
Open

saveJson and saveRest not working as per the example #178

rhatherall opened this issue Jul 7, 2015 · 1 comment

Comments

@rhatherall
Copy link

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
Copy link
Contributor

Petah commented Jul 14, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants