`
PBFox
  • 浏览: 66064 次
  • 性别: Icon_minigender_1
  • 来自: China
文章分类
社区版块
存档分类
最新评论

in_place_editing in rails 2.1.0

阅读更多

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

“If you’re receiving this error while using the in_place_editor_field method, chances are you’re iterating through a list of objects and you’re passing the variables to the method incorrectly.

To fix this problem, set the current iteration as an instance variable and you should be fine.

For example:

<% for person in @people %>
<% @person = person %>
<%= in_place_editor_field :person, :name %>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics