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 %>

發佈了12 篇原創文章 · 獲贊 169 · 訪問量 30萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章