Editing FlexImage filenames

I'm using FlexImage to upload files, and I want to also be able to go
back and edit the file.

So an edit operation would produce the name of the file that was
uploaded, and produce a thumbnail for visual reference, with the ability
to delete this image entirely, or to change it's uploaded path/image.

Would I need to add a column to my Images table to save the uploaded
path, and then populate the file_field with that value? (Is there even a
way to populate the file_field with a previous value?)

Any thoughts or experiences would be time saving and appreciated.


OK. different question, but I'll keep it in the same thread, since Its
FlexImage related.

What is the best way to display multiple images that are already in the
database from a FlexImage upload?

I have multiple photos that belong to one listing (one-to-many), I was
going to do a render_flex_image() on one of the images, but I'm getting
an error back that it doesn't like the datatype I'm handing in (Array)

  @listing = Listing.find(9)
  @image = Photo.find(:all, :conditions => [ "listing_id = ?", @listing.id ] )
  # @image is an array of 1 image
--> undefined method `data_field' for Array:Class

If I use the following instead:

I don't get an error, and I get the image, but without any layout.

What am I doing wrong?

Ultimately, I just want to display numerous photos on the same page.


Can render_flex_image() take an Array of images?

What is the proper usage/intent of render_flex_image() ?

When I use it, it only displays an image, no layout, is that the proper

> Can render_flex_image() take an Array of images?

No. Since you can only send 1 response per request, you can only render
1 image per request.

I think this is the crux of my mis-understanding.

What does render_flex_image do?

Thanks for the extended description, I think his explains why the view
source was garbled. :slight_smile:

So render_flex_image really is intended to only display a single image
in the browser, with no extra markup ?

So if I wanted to display an array of images in a specified layout, I
could use something like:

render :action => 'display_images_with_layout'

and then have a display_images_with_layout.rhtml file that loops through
the images per your previous post?