In_place_editor_field problem


#1

I have a bit of a problem…

I am rendering a table of objects using a partial with a collection of
those objects. Inside of the partial, I’m trying to use an
in_place_editor_field tag using the current object form the collection.
Rails doesn’t seem to like this.

Does in_place_editor_field require a member variable that is set in the
controller? Since I’m using a variable named after the partial (since
it is in a collection passed to the partial), is there anyway to get
those table rows to include in_place_editors without re-inventing the
wheel and writing my own code?


#2

Dave S. wrote:

I have a bit of a problem…

I am rendering a table of objects using a partial with a collection of
those objects. Inside of the partial, I’m trying to use an
in_place_editor_field tag using the current object form the collection.
Rails doesn’t seem to like this.

Does in_place_editor_field require a member variable that is set in the
controller? Since I’m using a variable named after the partial (since
it is in a collection passed to the partial), is there anyway to get
those table rows to include in_place_editors without re-inventing the
wheel and writing my own code?

When I did my in_place_editor_field I had to put something like:

in_place_edit_for :user, :first

in the controller. Not sure why this code is required, I would be
interested to know why myself. I had help when doing my
in_place_edit_field. I imagine it’s something like a pre-processing
directive.

~S


#3

When I did my in_place_editor_field I had to put something like:

in_place_edit_for :user, :first

in the controller. Not sure why this code is required

This creates the controller method that the in_place_editor_field
javascript calls.


#4

Dave S. wrote:

Does in_place_editor_field require a member variable that is set in the
controller? Since I’m using a variable named after the partial (since
it is in a collection passed to the partial), is there anyway to get
those table rows to include in_place_editors without re-inventing the
wheel and writing my own code?

You can just do a <% @member = my_thing %> in the partial.


Roderick van Domburg
http://www.nedforce.nl