【问题标题】:live editing field using best_in_place gem activator button on rails 3使用 rails 3 上 best_in_place gem 激活器按钮的实时编辑字段
【发布时间】:2013-03-25 05:12:24
【问题描述】:

我使用 best_in_place gem 编辑评论列表。这是我的代码。只是工作。但是创建新评论时失败了。几分钟后它也可以工作并刷新页面

%= 评论:内容类型::textarea,路径:commen_path(comment),激活器:“#activator-#{comment.id}”%>

('.best_in_place').best_in_place();该代码在 js 文件中包含 best_in_place。

也许它包括实时绑定...但是如何?

【问题讨论】:

  • 您遇到的错误是什么?还要注意你的路径是错误的,应该是comment_path而不是
  • 所有评论列表都可以使用,但 best_in_place js 无法进行新评论编辑。

标签: ruby-on-rails-3 best-in-place


【解决方案1】:

它对我有用:

<% Comment.where(:user_id =>current_user.id).each do |comment| %>
  <%= best_in_place comment,:content %>
<%end%>

【讨论】:

    猜你喜欢
    • 2012-09-27
    • 1970-01-01
    • 2011-08-01
    • 2013-03-06
    • 1970-01-01
    • 2023-03-13
    • 1970-01-01
    • 2017-10-17
    • 2012-03-26
    相关资源
    最近更新 更多