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

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.
Lee (Guest)
on 2007-07-15 10:27
(Received via mailing list)
Hi,

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_#{property.id}", :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?

Thanks.
Roderick v. (Guest)
on 2007-07-15 13:30
No, not without hacking the in_place_editor.

--
Roderick van Domburg
http://www.nedforce.nl
This topic is locked and can not be replied to.