on_the_spot gem不起作用

时间:2011-07-21 04:21:41

标签: ruby-on-rails gem

我刚刚按照github说明安装了“on_the_spot”gem。

我正在尝试为索引操作创建就地编辑。当我将鼠标悬停在应该可编辑的文本上时,没有任何反应。只有背景颜色会发生变化。

这是我索引视图中的相关代码

<% @part_types.each do |part_type| %>
<tr>
  <td><%= on_the_spot_edit part_type, :title %></td>
</tr>
<% end %>

来自控制器:

class PartTypesController < ApplicationController

#on_the_spot for in place editing
can_edit_on_the_spot
#.. rest of the controller code
end

添加到路线:

resources :part_types do
  collection do
    put :update_attribute_on_the_spot
  end
end

nginx在这些更改后已经重新启动。

谢谢

1 个答案:

答案 0 :(得分:0)

在Gemfile中添加以下内容:

gem“on_the_spot” 运行安装任务:

rails g on_the_spot:install

如果您使用rails 3.1将创建的文件替换为app / assets / javascripts(两个文件jquery.jeditable.mini和on_the_spot)