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 Denenberg <straightflush@gmail.com> wrote:> 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 >
On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote:> shameless bump since i am sure there is a helper to help do this ! > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > 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 > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >That behavior should work with the default find_column_field helper. -- Kyle Maxwell Chief Technologist E Factor Media // FN Interactive kyle@efactormedia.com 1-866-263-3261
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 On 1/12/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > shameless bump since i am sure there is a helper to help do this ! > > > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > > 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 > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > That behavior should work with the default find_column_field helper. > > -- > Kyle Maxwell > Chief Technologist > E Factor Media // FN Interactive > kyle@efactormedia.com > 1-866-263-3261 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote:> 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 > > On 1/12/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > > shameless bump since i am sure there is a helper to help do this ! > > > > > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > > > 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 > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > That behavior should work with the default find_column_field helper. > > > > -- > > Kyle Maxwell > > Chief Technologist > > E Factor Media // FN Interactive > > kyle@efactormedia.com > > 1-866-263-3261 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >The absolute easiest way would be to <div style="visibility:hidden"><%=file_column_field ... %></div>. I''ll let you figure out equivalent methods. -- Kyle Maxwell Chief Technologist E Factor Media // FN Interactive kyle@efactormedia.com 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 On 1/13/06, Adam Denenberg <straightflush@gmail.com> wrote:> > 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 > > On 1/12/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > > shameless bump since i am sure there is a helper to help do this ! > > > > > > On 1/12/06, Adam Denenberg <straightflush@gmail.com> wrote: > > > > 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 > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > That behavior should work with the default find_column_field helper. > > > > -- > > Kyle Maxwell > > Chief Technologist > > E Factor Media // FN Interactive > > kyle@efactormedia.com > > 1-866-263-3261 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/2679eeb9/attachment-0001.html