I'm not able to get past this... Basically I'm displaying my
"Participant" and wish to display participant details which includes
several partials. I've studied this over and over and I cannot fathom
how an infinite loop can come from showing an object and its sub-
objects. Feel like I'm getting nuts here. Are there other reasons
we can get this error "stack level too deep"?
Showing participants/show.html.erb where line #63 raised:
Until I comment out so many lines that there are none for it to
complain about
Showing participants/show.html.erb where line #63 raised:
stack level too deep
Extracted source (around line #63):
<nothing here>
Then I reboot webrick. Then it works fine for one hit to 'http://
localhost:3001/participants/show", but not any subsequent
refreshes. Perhaps its my IDE? Radrails 1.2.7.024747
I'm not able to get past this... Basically I'm displaying my
"Participant" and wish to display participant details which includes
several partials. I've studied this over and over and I cannot fathom
how an infinite loop can come from showing an object and its sub-
objects. Feel like I'm getting nuts here. Are there other reasons
we can get this error "stack level too deep"?
Showing participants/show.html.erb where line #63 raised:
This use of locals looks a bit weird, but i don't think it is the
problem
Then I reboot webrick. Then it works fine for one hit to 'http://
localhost:3001/participants/show", but not any subsequent
refreshes. Perhaps its my IDE? Radrails 1.2.7.024747
Unlikely. Stuff that works for one request only usually indicates that
the code that reloads your source in between requests has got
confused.
One way of doing this is using require to require classes from your
app: either don't use require (let rails load things magically) or use
require_dependency as that keeps rails in the loop about what you are
doing
To add to Fred's note, you don't need to pass a controller class level
variable (@participant) as a local variable to a second partial in the
same request cycle as it is already visible.