2011-07-21 35 views
0

我刚刚安装了遵循github说明的“on_the_spot”gem。on_the_spot宝石不工作

我试图为我的索引操作创建一个就地编辑。当我将鼠标放在应该可编辑的文本上时,什么都不会发生。只有背景颜色改变。

这是我的索引视图

<% @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的。

谢谢

+0

解决。我已经删除了一些JavaScript文件。只需加载jquery.js,application.js和“on_the_spot”js创建的文件即可。 –

回答

0

内,您的Gemfile中添加以下内容:

宝石 “on_the_spot” 运行安装任务:

轨摹on_the_spot:如果u使用Rails 3.1更换安装

创建文件到app/assets/javascripts(两个文件jquery.jeditable.mini和on_the_spot)