RoR newbie need help with forms for a class project

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

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,
~Chad

Have 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