Forum: Ruby on Rails const_missing & undefined method problems upgrading to Rails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
27f8beb57f4d56d328749b51ac886d2c?d=identicon&s=25 Kian (Guest)
on 2006-05-04 01:48
(Received via mailing list)
Finally getting around to upgrading our application to Rails 1.1.2.

Of course, nothing runs correctly after the upgrade. So far two major
perhaps related. Any help would be greatly appreciated.

1. We're getting const_missing errors. Specifically when trying to use
constants in a custom helper method, being called from a layout
template. The
class constants were for controller classes (but not the current
Rails 1.0 (and previous) used to just find and load these automatically,
1.1.2 throws an error.

The weird thing is that it apparently only does this on some of the
classes that are being referenced; the others load fine. I've checked
that the
class name to file name conversion via #demodulize.underscore seems to
work OK.

Did a little bit of debugging in active_support/dependencies.rb
Module#const_missing (where the error occurs). It appears that other
failures are being solved by the 'Attempt to access the name from the
bit of code, but not this one.

I fixed this one with a brute force approach at the beginning of the
  require "#{RAILS_ROOT}/app/controllers/*"
but I'd rather not do that.

2. Now I'm getting 'undefined method' errors from my templates
(specifically in
a template rendered from within another template, but not a partial).
methods in question are in a helper file that is included into

In fact, it appears that none of the methods in my application_helper.rb
available in my view object (as listed by self.methods.sort.inspect).
ApplicationHelper module, and any modules that should be included in it,
are not
shown as ancestors in the template either

Weirdly, the layout uses (different) methods from application_helper and
included modules without any problems whatsoever.

Maybe I was playing fast & loose with previous versions of Rails, but I
 this upgrade was supposed to be painless.

Any ideas, suggestions, etc?

Thanks, Kian
This topic is locked and can not be replied to.