# Recursive partial wasted my 2 hours

**URL:** <https://www.ruby-forum.com/t/recursive-partial-wasted-my-2-hours/170060>\
**Category:** Rails\
**Created:** [June 11, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/recursive-partial-wasted-my-2-hours/170060 "2009-06-11T20:37:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 11, 2009, 8:37pm UTC](https://www.ruby-forum.com/t/recursive-partial-wasted-my-2-hours/170060/1 "2009-06-11T20:37:13Z")

</div>

Hi,

When I called a page, the server choked like frozen.  
I checked it with ‘top’ command and HDD(wa) was 95%.  
There’s no error or suspicious log.

After wasting 2 hours, I found that a partial called it self.  
In \_a.html.erb  
\<%= render :partial =\> “a” %\>

Can rails detect such a mistake and stop proceeding and report it?

Thanks.

Sam

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 11, 2009, 11:38pm UTC](https://www.ruby-forum.com/t/recursive-partial-wasted-my-2-hours/170060/2 "2009-06-11T23:38:39Z")

</div>

On Jun 11, 7:37 pm, Sam K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can rails detect such a mistake and stop proceeding and report it?

In the absolute is this not the same as trying to solve the halting  
problem ? (which has been proved to be unsolvable)

Fred

---

<div class="post-metadata">

**Author:** ![ssk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/82dd89/32.png) [@ssk](https://www.ruby-forum.com/u/ssk)\
**Post date:** [June 12, 2009, 5:43pm UTC](https://www.ruby-forum.com/t/recursive-partial-wasted-my-2-hours/170060/3 "2009-06-12T17:43:24Z")

</div>

Every time I’ve done something like that, Rails has pulled me up short  
with a “stack level too deep” error. That’s usually the only way you  
can catch these things. Mistakes like this can’t be caught  
automatically, since a partial calling itself can sometimes be valid  
(when displaying a tree, for instance).

–Matt J.
