Dominique Plante
2006-Aug-24 17:57 UTC
[Rails] How to display user data from one page on another?
Can someone point me at some code that shows how to create a controller and a view that prompts the user to enter some data, and then displays this same data on another page (and I don''t want to persist this to the database). For instance, let''s say I had a search page that had the following * a text input field that prompted the user to enter a search term * text input fields that prompted the user for a date range (a text field for start date, a text field for end date) * a drop down list that allowed users to pick an arbitrary category (or all categories) * a submit button Suppose a user entered "beer" as their search term, "03/10/05 - 08/24/2006" as their date range, and they selected the category "Beers of Canada" How would I get this page to link to another view in the same controller that would say: * the search term you entered was: beer * the date range you selected was 03/10/05 - 8/24/2006 * the category you entered was: Beers of Canada Thanks! Dominique -- 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 -~----------~----~----~----~------~----~------~--~---
Peter
2006-Aug-24 18:05 UTC
[Rails] Re: How to display user data from one page on another?
session[:remember_next_page] = params[:category] -- 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 -~----------~----~----~----~------~----~------~--~---
koloa
2006-Aug-24 18:14 UTC
[Rails] Re: How to display user data from one page on another?
hello, i did something similiar. all i did was use link_to and pass however amount of parameters i wanted to remeber to the next view. -- 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 -~----------~----~----~----~------~----~------~--~---
Clayton Cottingham
2006-Aug-24 18:23 UTC
[Rails] Re: How to display user data from one page on another?
Say you have a action named form and another it posts to called display when you submit the form have it submit to the action display then in your controller in the display action you can just access those params and display them in your view -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Dominique Plante Sent: Thursday, August 24, 2006 10:57 AM To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] How to display user data from one page on another? Can someone point me at some code that shows how to create a controller and a view that prompts the user to enter some data, and then displays this same data on another page (and I don''t want to persist this to the database). For instance, let''s say I had a search page that had the following * a text input field that prompted the user to enter a search term * text input fields that prompted the user for a date range (a text field for start date, a text field for end date) * a drop down list that allowed users to pick an arbitrary category (or all categories) * a submit button Suppose a user entered "beer" as their search term, "03/10/05 - 08/24/2006" as their date range, and they selected the category "Beers of Canada" How would I get this page to link to another view in the same controller that would say: * the search term you entered was: beer * the date range you selected was 03/10/05 - 8/24/2006 * the category you entered was: Beers of Canada Thanks! Dominique -- 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 -~----------~----~----~----~------~----~------~--~---
Dominique Plante
2006-Aug-25 00:11 UTC
[Rails] Re: How to display user data from one page on another?
I will try that and let you know Clayton Cottingham wrote:> Say you have a action named form > > and another it posts to called display > > > when you submit the form have it submit to the action display > > > then in your controller in the display action > > you can just access those params and display them in your view-- 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 -~----------~----~----~----~------~----~------~--~---