File_column preview in multistage forms

i have a 2 step form which contains 1 file_column field.

The second form is just “This is how your post will look” kind of form
and the user can click Edit (to take them back to form1) or Submit.
If the user clicks edit it takes them back to the first form with
fields populated. I have it working with all text fields, I just dont
know how to do this with file_column field (showing the image and file
selected). Storing the @params[:post][“image”] field in a session
crashes rails. So what i cant figure out is

  1. how do i reference the temporary image in my second form to show
    how the post will look
  2. how do i re-populate the user’s choice in the first form if there
    is an error, or the user wants to go back and edit from form2?

thanks
adam

shameless bump since i am sure there is a helper to help do this !

On 1/12/06, Adam D. [email protected] wrote:

selected). Storing the @params[:post][“image”] field in a session


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

That behavior should work with the default find_column_field helper.


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
[email protected]
1-866-263-3261

On 1/12/06, Adam D. [email protected] wrote:

Maybe i am missing something here, but i dont see how this is possible.

  1. how do i re-populate the user’s choice in the first form if there

Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

The absolute easiest way would be to

<%=file_column_field … %>
. I’ll let
you figure out equivalent methods.


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
[email protected]
1-866-263-3261

Adam,

How about this: first action creates the object containing the image and
populates it from ‘params’. Keep it in a instance variable like
@my_image
and also put it into the session, @session[‘partial_image’] = @my_image.
Render your preview page using:

<%= image_tag url_for_file_column("@my_image", “image_column”)

In your second action, retrieve the partial image object and perform a
save.

I’m doing this in my current app.

Joe

i am not sure how. if i have a file_column_field in step1, and i only
want to display the image without putting another “Browse” button on
the second step (which i now figured out how to do as a sort of
preview step), the params[:post][“image”] attribute is now gone, as is
the image when the controller gets it on submission

. How do you drop this in the second step form, so that when the user
clicks submit on step2, @params[:post][“image”] goes with it (using
the image chosed in step1) ?

Maybe i am missing something here, but i dont see how this is possible.

thanks
adam