Forum: Ruby on Rails in_place_field_editor: Must you have an instance variable?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
05748a61a1b05130ec508434301aecf1?d=identicon&s=25 Lee (Guest)
on 2007-07-15 08:27
(Received via mailing list)

I am trying to implement in_place_field_editor into my UI in a limited
but useful way.

I want to use in_place_field_editor within a partial that is called
from a view as shown here:

    <%= render :partial => "shared/property",
               :collection => @properties,
               :locals => {:member_entity => @logged_in_member_entity}

Within the "property" partial, I use the "property" local variable
(current entry of the :collection).

I should like to use in_place_field_editor to edit the name attribute
of "property" as shown here:

          <%= in_place_editor_field :property, :name, {},
{:external_control => "rename_name_#{}", :save_text =>
"update" } %>

To get this to work I must  first do  <% @property = property %>

Is it possible to avoid this last statement and just to refer to the
local variable "property" within the in_place_editor_field call?

4375b4aca04b8d72482fd409fb6d0b47?d=identicon&s=25 Roderick van Domburg (roderickvd)
on 2007-07-15 11:30
No, not without hacking the in_place_editor.

Roderick van Domburg
This topic is locked and can not be replied to.