I just ran into this problem in an action that had nothing to do with
a view (the action was just rendering a status code).

Any chance you are assigning an AR class to a variable, and then
calling methods on that variable like so:

saved_class = User  # User is AR
saved_class.create(whatever)

When I changed that to this:

saved_class = :User
Object.const_get(saved_class).create(whatever)

everyone was happy.


I've love to track down why this is happening in my case -- but no
time.  Plus, that's the way thoughtbot does it in factory_girl, so
it's gotta be right :-)

Good luck.

On Dec 20, 1:26 pm, "Jeffrey L. Taylor" <[email protected]> wrote:
> Quoting Jeffrey L. Taylor <[email protected]>:
>
>
>
>
>
> > Quoting KenM <[email protected]>:
>
> > > Some further information....
>
> > > This issue is apparently caused by not passing enough parameters to
> > > the route helpers when you have nested resources.  For example, I have
> > > a gallery, which has a nested image resource.  When generating links
> > > in the view, I called the helper, but I didn't pass an array with both
> > > the gallery and the image, only the image.
>
> > > The first time presenting the view would work; the second, I would get
> > > the stack trace, and from that point on the mongrel instance is
> > > hooped, and would not serve any content.  It would have to be
> > > restarted.
>
> > > I've fixed the view, and the problem is now resolved.
>
> > > However, I'm concerned about being able to crash mongrel hard this
> > > way.....
>
> > I was getting similar errors I started using Rails.cache w/ Rails 2.2.2.  
> > I'm
> > using Webrick, not Mongrel.  I gave up and went back to using my homegrown
> > caching.  With you information about not enough parameters, I may go back 
> > and
> > try again.
>
> I went back and looked hard at my code that was crashing.  I was missing a
> parameter to a yield statement.  So Rails appears to be brittle around this
> issue.  And maybe Mongrel more brittle than Webrick.
>
> Thanks for the hint.  It is always nice to get rid of code that I have to
> maintain in favor of builtin stuff that someone else maintains.
>
> Jeffrey
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to