我使用的宝石在我的轨道“jeditable-轨”的就地编辑工作 3.2应用程序在我的控制,我有苗条文件不执行JS里面
def update
@article = Article.find(params[:id])
@article.update_attributes(params[:article])
render :layout => false if request.xhr?
end
,并在我的文章/更新。 js.slim
我有
- unless @article.errors.empty?
| $("#error_msg").html(@article.errors);
- else
| $("#success_msg").html("updated successfully");
但是当我做一个更新它更新和去js文件,并使得它喜欢,因为它是。 像$("#error_msg").html(@comment.errors);
打印为这样或$("#success_msg").html("updated successfully")
编辑:
我使用了编辑jeditable插件代替我的文章标题孤单。它更新文章标题和呈现js文件,因为它是
我在这里得到的回应是json。如何解决这个问题。 GI建议
我真的不明白你的问题,但我会尝试猜测,建议您调试JavaScript作为[本文]在(HTTP ://www.alfajango.com/blog/rails-js-erb-remote-response-not-executing/)。 – 2012-03-25 07:12:37
请更明确地描述你的问题,因为我没有明白你的观点。 – 2012-03-25 07:29:45