Frederic Oehl
2007-May-23 09:43 UTC
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Thomas
2007-May-23 16:08 UTC
Re: creating a tempfile that should be used by 2 controllers
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Thomas
2007-May-23 16:08 UTC
Re: creating a tempfile that should be used by 2 controllers
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Thomas
2007-May-23 16:08 UTC
Re: creating a tempfile that should be used by 2 controllers
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederic Oehl
2007-May-24 07:23 UTC
Re: creating a tempfile that should be used by 2 controllers
Mark Thomas 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---