Wrapping indiv renders when rendering collection

I’m new to Rails - still trying to figure out the cleanest place to
put things.

I wrote my own in-place-editor that gives me a bit more support for
things like lists. Works fine, but it requires that every item in the
list be rendered wrapped in a with the item’s object id.

i’ve been using render :update :partial :collection, and putting the
s explicitly in the partial view. but that’s ugly. it requires
that whenever i reuse this mechanism, i have to know how it works.
i’d rather be able to write the partial view without the and
have it added in.

but how? i could use a layout, i suppose, in the render. but then i
have to be sure the layout is there and named the right thing.

i tried things like render :update :collection :inline, to wrap the
view, but that doesn’t work and seems ugly.

so - what’s the right idiomatic way to do this in Rails? suck it up
and remember the layout file? create the layout file from the lib
file that provides the in-list-editor capability? do something else?

opinions welcome. thx.

On 6/8/07, Mike [email protected] wrote:

that whenever i reuse this mechanism, i have to know how it works.
and remember the layout file? create the layout file from the lib
file that provides the in-list-editor capability? do something else?

opinions welcome. thx.

I think what you are asking is covered in this episode of rails cast.


Edward Grant
[email protected]