Creating a tempfile that should be used by 2 controllers

Hi,

To summarize I have an application with two pages:

  • one is a form and a controller is attached to it. Crontoller generates
    a file given the information entered in the form;
  • the other is a download-page and also has its own controller…

In single-user mode I had no problem as I always used the same name for
the file. Now, I want to go to multi-users mode. I was thinking of using
tempfile but I can’t get the two controller to use the same tempfile…

Do you think it is possible to have two controllers using the same
tempfile? Or may be my design is incorrect… any help welcome! Thanx

Regards,

Fred

Why do you think you need multiple controllers? A controller can have
multiple actions, and actions have views associated with them. What
you’ve described seems to be two actions. I don’t see a need for a
second controller, and I also don’t see a need for a temp file. Why
not send a file directly to the user as the response of an action.

  • Mark.

Why do you think you need multiple controllers? A controller can have
multiple actions, and actions have views associated with them. What
you’ve described seems to be two actions. I don’t see a need for a
second controller, and I also don’t see a need for a temp file. Why
not send a file directly to the user as the response of an action.

Why do you think you need multiple controllers? A controller can have
multiple actions, and actions have views associated with them. What
you’ve described seems to be two actions. I don’t see a need for a
second controller, and I also don’t see a need for a temp file. Why
not send a file directly to the user as the response of an action.

  • Mark.

Mark T. wrote:

Why do you think you need multiple controllers? A controller can have
multiple actions, and actions have views associated with them. What
you’ve described seems to be two actions. I don’t see a need for a
second controller, and I also don’t see a need for a temp file. Why
not send a file directly to the user as the response of an action.

  • Mark.

I thougth needed 2 controllers cause of 2 different views… I didn’t
think of sending file to finish in first controller. Wanted to offer
downloading and emailing option in the second view but just realised
could just add a field in the form to do that.

Thank you for the help.

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs