# Strange helper error

**URL:** <https://www.ruby-forum.com/t/strange-helper-error/155032>\
**Category:** Rails\
**Created:** [December 6, 2008, 4:35pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032 "2008-12-06T16:35:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schalk\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Post date:** [December 6, 2008, 4:35pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032/1 "2008-12-06T16:35:03Z")

</div>

Hey everyone,

I have a controller called CMSController and then a helper called  
cms\_helper.rb. When trying to access my application I get the following:

C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:249:in  
`load\_missing\_constant’

Expected C:/DEVELOPMENT/satechevents/app/helpers/cms\_helper.rb to define  
CmsHelper

But the file cms\_helper.rb is just an empty helper created when I  
created the controller using script/generate

Any ideas?

Regards,  
Schalk

---

<div class="post-metadata">

**Author:** ![Schalk\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Post date:** [December 6, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032/2 "2008-12-06T16:37:23Z")

</div>

Hi,

Your empty cms\_helper.rb helper should contains

module CmsHelper  
end

Is it the case?

Jej

---

<div class="post-metadata">

**Author:** ![Schalk\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Post date:** [December 6, 2008, 4:44pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032/3 "2008-12-06T16:44:25Z")

</div>

Hi there,

Yip, that is exactly what it contains. Should every controller have an  
associated model?

Thanks,  
Schalk

---

<div class="post-metadata">

**Author:** ![Schalk\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Post date:** [December 6, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032/4 "2008-12-06T17:15:26Z")

</div>

Schalk N. wrote:

> Expected C:/DEVELOPMENT/satechevents/app/helpers/cms\_helper.rb to define  
> CmsHelper

In general, whenever that happens, spot-check the file with

ruby app/helpers/cms\_helper.rb  
script/runner app/helpers/cms\_helper.rb

Sometimes when the Magic Loader finds a syntax error inside a file, it  
throws  
the error away, then complains the file did not define its target class.

Next, calling a controller CMSController gives me a bad feeling. Maybe  
Rails  
parses it correctly, but we always go with like CmsController.

> Should every controller have an associated model?

No; a controller is like a telephone operator switchboard. It just plugs  
models  
and views together so they can communicate.

How are your unit tests doing?

–  
Phlip

---

<div class="post-metadata">

**Author:** ![Schalk\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@Schalk\_N](https://www.ruby-forum.com/u/Schalk_N)\
**Post date:** [December 6, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/strange-helper-error/155032/5 "2008-12-06T20:39:26Z")

</div>

Hi there Phlip,

Changing to Cms as apposed to CMS did the trick, thanks!

Regards,  
Schalk
