Forum: Ruby on Rails attachment_fu and get file from session.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Solid (Guest)
on 2007-07-25 14:55
(Received via mailing list)
Hello,

I'm using the attachment_fu right now and I don't know how to get the
image from session to the browser, before I'll save it. How to output
uploaded_data to the browser?

(I think there are two ways: 1) saving into the temporary file; 2) or
get it straight from the action; )

Dmitry
Ramon T. (Guest)
on 2007-07-25 20:42
(Received via mailing list)
Hi Solid.  Sorry, could you repeat your question?  Attachment_fu
automatically knows how to read the "uploaded_data" part in the file
field.

On 7/25/07, Solid <removed_email_address@domain.invalid> wrote:
> Dmitry
>
>
> >
>


--
Ramon T.
Solid (Guest)
on 2007-07-26 00:51
(Received via mailing list)
Sorry that I were not able to describe my problem a bit better.

I have two controllers questions and answers. When I'm creating a new
question, I need to add some answers to this question. So I'm going to
the answer controller and adding some answers with some images to the
*session*, because I don't want to save answers at this moment (maybe
a question will not be created, and also for the easy save... for
example: @questions.answers = session[:answers] @question.save). So
I'm adding my answers to the session... and when I'm trying to edit
this temporary answers, I need to show images for every answer.

The question: how can I output images from the temporary (session)
answers?

I see only two ways how to do that, but maybe that isn't a best
practice.

1) save uploaded_data to a temporary file (the problem, sometimes we
need to cleanup the temporary folder);
2) output from some answer action, for example named "temporary_image"
the uploaded_data to a browser.

Thank you again,
Dmitry

On Jul 25, 7:41 pm, "Ramon Miguel M. Tayag" 
<removed_email_address@domain.invalid>
This topic is locked and can not be replied to.