Closed roblingle closed 10 years ago
Thank you for reporting :satisfied: I was not expecting turbolinks (& probably jquery-turbolinks), so the problem you say is likely to occur. I think It is only necessary to ensure this script doesn't run twice. Anyway, I'll continue to look into it. :mag:
@roblingle I tried to fix this issue in very simple way. It works on my code. Please try this fix on your code. If it works, I release it soon.
Looks like a fix. Thanks!
On Mon, Jun 9, 2014 at 5:55 AM, Toru KAWAMURA notifications@github.com wrote:
@roblingle https://github.com/roblingle I tried to fix this issue in very simple way. It works on my code. Please try this fix on your code. If it works, I release it soon.
— Reply to this email directly or view it on GitHub https://github.com/bootstrap-ruby/bootstrap-editable-rails/issues/20#issuecomment-45476091 .
I've released it. Thanks a lot! :satisfied:
Not sure this is really an issue for you, but I've seen a couple people run into it with bootstrap-editable-rails and x-editable-rails. It seems to happen with turbolinks. I think we fixed it for ourselves.
We're using editable in a maybe slightly unusual way, so I'm not sure most Rails apps would ever see this. We have all of our photos on a page and a user can click a photo to bring up the details in a modal for view and edit. This means we have to change Editable options on each photo click event, but I don't think that was causing the problem.
We started seeing this:
I found the problem happens when the user clicks a photo to bring up the modal (makes changes which do work normally or changes nothing), goes to another page, comes back, makes a change to an editable field, and clicks save.
Seems to be somewhere around here:
After a page change, this.options.url became a recursive call to itself. To get around it, I removed
//= require bootstrap-editable-rails
from application.js and replaced it with a slightly modified coffeescript version in this gist. Seems happy now.Hope it helps, and thanks!