# .erb invoked unexpectedly

**URL:** <https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732>\
**Category:** Rails\
**Created:** [December 16, 2008, 6:02am UTC](https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732 "2008-12-16T06:02:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [December 16, 2008, 6:02am UTC](https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732/1 "2008-12-16T06:02:20Z")

</div>

I’ve got an app that starts up with:  
map.root :controller =\> “csvs”, :action =\> ‘startup’

The csvs\_controller.rb is posted on [http://www.pastie.org/340100](http://www.pastie.org/340100)

The startup routine checks the RAILS\_ROOT + “/public/data/csv”  
directory for any files. Presently, the directory has none.  
Consequently, “aHashes”, an array of hashes in line #112 should be  
empty.

That is indeed the case, as evidenced by the logger msg from line 113  
appearing in the Command Window running Mongrel.

Therefore I expect lines 114 & 115 to be honored, i.e. nothing to  
rendered and the index method to be invoked.

Instead, I get:  
Missing template csvs/startup.erb in view path K:/\_Projects/Ruby/  
\_Rails\_Apps/PayrollApp/app/views:

Why is the app attempting to render something I don’t expect ever to  
happen? (If I do find files, I’ll insert their attributes in the  
database and redirect to index.

Where am I going wrong?

Thanks in advance,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [December 16, 2008, 7:03am UTC](https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732/2 "2008-12-16T07:03:43Z")

</div>

## BTW, I included the routes.rb on that Pastie file.

R

On Dec 16, 12:01 am, RichardOnRails

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [December 16, 2008, 10:17am UTC](https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732/3 "2008-12-16T10:17:01Z")

</div>

On Dec 16, 6:03 am, RichardOnRails  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Why is the app attempting to render something I don’t expect ever to  
> > happen? (If I do find files, I’ll insert their attributes in the  
> > database and redirect to index.

You typoed :notihing

Fred

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [December 16, 2008, 3:54pm UTC](https://www.ruby-forum.com/t/erb-invoked-unexpectedly/155732/4 "2008-12-16T15:54:01Z")

</div>

Hi Fred,

As you’ve done many times, you pulled my fat out of the fire.

Once again, thank you very much.

Best wishes,  
Richarrd

On Dec 16, 4:16 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
