Prashant Tiwari
2006-May-09 07:04 UTC
[Rails] How to transfer variables from one page to another page ?
Hi, In my application I want to tranfer a variable (store_id) from one page to next without putting it into session. How should I do this? Is there any way to transfer variable from one to other page using methods other than sesion? Thanx Prash -- Posted via http://www.ruby-forum.com/.
Brian Hughes
2006-May-09 12:11 UTC
[Rails] How to transfer variables from one page to another page ?
On May 9, 2006, at 03:04 AM, Prashant Tiwari wrote:> In my application I want to tranfer a variable (store_id) from one > page > to next without putting it into session. How should I do this? > Is there any way to transfer variable from one to other page using > methods other than sesion?You do realize that this is _precisely_ why the concept of Session Management exists, in web applications, don''t you? Why would you not want to make use of that? As for other ways, the easiest (assuming you only have one or two simple values) is to pass the variables as parameters to the URL being called. That way, they will be part of the params[] object in the next action. -Brian
Jean-François
2006-May-09 12:29 UTC
[Rails] How to transfer variables from one page to another page ?
Hello Prashant,> In my application I want to tranfer a variable (store_id) from one page > to next without putting it into session. How should I do this? > Is there any way to transfer variable from one to other page using > methods other than sesion?You can use flash. flash[:store_id] = store_id then you retrieve in the second action : @id = flash[:store_id] -- Jean-Fran?ois. -- ? la renverse.
Ezra Zygmuntowicz
2006-May-09 16:36 UTC
[Rails] How to transfer variables from one page to another page ?
On May 9, 2006, at 5:29 AM, Jean-Fran?ois wrote:> Hello Prashant, > >> In my application I want to tranfer a variable (store_id) from one >> page >> to next without putting it into session. How should I do this? >> Is there any way to transfer variable from one to other page using >> methods other than sesion? > > You can use flash. > > flash[:store_id] = store_id > > then you retrieve in the second action : @id = flash[:store_id] > > -- Jean-Fran?ois. > > -Except flash is just stored in the session ;) Serioulsy, you need to give us more info as to why you don''t want to use the session? Sessions whole reason to exist is to hold state between stateless http transactions. -Ezra