有人知道是否可能(如果可以的话,语法是什么)使用嵌套资源与best_in_place宝石?
我的routes.rb文件大致如下:
resources :users do
resources :goals
end
我想编辑目标的:description
字段,但我在视图中的代码为:
<%= best_in_place [@user, @goal], :description %>
出现 NoMethodError 错误
undefined method `description' for #<Array:0x20e0d28>
使用
<%= best_in_place @goal, :description %>
由于没有goal_path
,给我一个未定义的方法错误。
我可以在没有问题的情况下为@user(非嵌套资源)字段使宝石正常工作。
我正在运行Rails 3.1.1、Ruby 1.9.2和best_in_place 1.0.4。