rails 3 best_in_place编辑在不刷新页面的情况下不起作用 [英] rails 3 best_in_place edit not working without refreshing the page
问题描述
我从Bernat的博客rails mini教程中获取了注释代码
I took the comments code from Bernat's blog rails mini tutorial
我尝试使用他的best_in_place宝石添加就地编辑功能.在大多数情况下,它工作正常
I tried adding the edit in place functionality by using his best_in_place gem. For the most part it worked right
我的代码部署在 http://falling-spring-3964.herokuapp.com/comments
您可以在此处查看代码 https://github.com/sunnygill/commentsapp
You can look at the code here https://github.com/sunnygill/commentsapp
问题:
- 我添加了一条新评论.它完美地显示在页面顶部,但是名称的就地编辑不起作用
- 如果刷新页面,则可以进行速度编辑
问题:
如何在不刷新页面的情况下进行就地编辑
How can i make the in place editing work without refreshing the page
推荐答案
我遇到了同样的问题,我的解决方案是将$('.best_in_place').best_in_place();
添加到create.js.erb
文件中.
I encountered the same problem, and my solution is add $('.best_in_place').best_in_place();
to the create.js.erb
file.
这篇关于rails 3 best_in_place编辑在不刷新页面的情况下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!