Hey all, I really need some help. I''m working with Ruby on Rails for the first time for a freelance project for a class I''m taking. I can''t seem to pass data between pages to save my life, and I could really use some help. Here is my problem. A user is a case registration page. They input some data and press submit -> they are taken to a sample registration page. This page displays all the information from the last page, and allows them to add a sample. This page lists all the samples tided to a specific case. After you add a sample -> you are takin to another page to confirm the sample number. After that is done you are taken back to the sample registration page, this page should show all the stuff from the original case registration page and now should contain the sample you just added. The problem I''m having is after one loop, I don''t get the case information again it''s all empty. I tried to fix it, and now I get nul object getting passed. The structure of this is: A person owns many cases. A case contains many samples. If someone could post code I could use to pass the data I need between the pages (the rest of the data is going over a form). That would help so much. Thanks a bunch in advance, ~Chad -- 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 -~----------~----~----~----~------~----~------~--~---
Alan Francis
2007-Feb-05 12:25 UTC
Re: RoR newbie need help with forms for a class project
Chad wrote:> Hey all, > > I really need some help. I''m working with Ruby on Rails for the first > time for a freelance project for a class I''m taking. I can''t seem to > pass data between pages to save my life, and I could really use some > help. > > Here is my problem. > > A user is a case registration page. They input some data and press > submit -> they are taken to a sample registration page. This page > displays all the information from the last page, and allows them to add > a sample. This page lists all the samples tided to a specific case. > After you add a sample -> you are takin to another page to confirm the > sample number. After that is done you are taken back to the sample > registration page, this page should show all the stuff from the original > case registration page and now should contain the sample you just added. > > The problem I''m having is after one loop, I don''t get the case > information again it''s all empty. I tried to fix it, and now I get nul > object getting passed. > > The structure of this is: > > A person owns many cases. A case contains many samples. > > If someone could post code I could use to pass the data I need between > the pages (the rest of the data is going over a form). That would help > so much. > > Thanks a bunch in advance, > ~ChadHave you tried using the session hash ? session[:key] = value ISTR you need to add model :blah to the ApplicationController to be able to store a full model in the session (as opposed to strings and ids) HTH Alan -- 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 -~----------~----~----~----~------~----~------~--~---