Forum: Ruby on Rails In_place_editor_field throws error ...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
James W. (Guest)
on 2006-03-28 18:00
I receive the following error:
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id

when trying to use the in_place_editor_field tag:

<% for employee in @employees %>
<%= in_place_editor_field :employee, employee.fname %>
<% end %>

My model is called Employee and is being populated from a controller
method employees_list:

@employees = Employee.find_all

When I take the <%= in_place_editor_field :employee, employee.fname %>
out everything is back to normal.

ANy ideas, I have performed a search but no luck.
Luigi R. (Guest)
on 2006-04-06 00:08
(Received via mailing list)
Did you have any luck in finding the solution to your problem?

In fact I'm stuck at your same point and the email sent to the list
later on didn't help too much. In particular I don't get an error when
using the following form:

<% for task in @tasks %>
<%= state_class(task.state_id) %> align='left'><%= @task = task;
in_place_editor_field :task , :body %>
<% end %>

But the resulting field in still *not* editable ...
Luigi R. (Guest)
on 2006-04-06 00:11
(Received via mailing list)
Ugh! In a few minutes I found the solution in another (older) mail in
the list:

"Make sure you have
<%= javascript_include_tag :defaults %>

in your page/layout's head."

It turns out I had not included the above :-(

Sorry to the list members for having posted maybe too quickly. In any
case, I'm posting this for someone who may encounter this issue in the
future.
This topic is locked and can not be replied to.