I am having some trouble with an old app I need to work on.. I have managed to get it mostly working with Rails 2.3, but I have run into this problem: undefined method `class_current_controller?'' for #<ActionView::Base:0x224c6a4> class_current_controller? is defined in application_helper.rb it should be finding it no? not sure what is going on here.. I tried writing a test method and calling that from the layout just to make sure and I get the same problem. any help much appreciated! thanks adam -- Posted via http://www.ruby-forum.com/.
Jeffrey L. Taylor
2009-Aug-05 04:14 UTC
Re: cant find method in application_helper from layout
Quoting Adam Wilson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > I am having some trouble with an old app I need to work on.. > > I have managed to get it mostly working with Rails 2.3, > but I have run into this problem: > > undefined method `class_current_controller?'' for > #<ActionView::Base:0x224c6a4> > > class_current_controller? is defined in application_helper.rb > > it should be finding it no? > not sure what is going on here.. > > I tried writing a test method and calling that from the layout just to > make sure and I get the same problem. >Is class_current_controller? a instance or a class method? Jeffrey
Its just a normal method defined in application_helper... I assume its an instance method of the helper, it is not defined as ''def self.method'' Its defined as: ''def class_current_controller?'' Thanks On Aug 5, 5:14 am, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting Adam Wilson <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>: > > > > > > > I am having some trouble with an old app I need to work on.. > > > I have managed to get it mostly working with Rails 2.3, > > but I have run into this problem: > > > undefined method `class_current_controller?'' for > > #<ActionView::Base:0x224c6a4> > > > class_current_controller? is defined in application_helper.rb > > > it should be finding it no? > > not sure what is going on here.. > > > I tried writing a test method and calling that from the layout just to > > make sure and I get the same problem. > > Is class_current_controller? a instance or a class method? > > Jeffrey
adamski wrote:> Its just a normal method defined in application_helper... I assume its > an instance method of the helper, it is not defined as ''def > self.method'' > Its defined as: ''def class_current_controller?'' > > ThanksOk the problem was, I am using comatose, and the comatose_admin layout did not have access to application_helper - solutions was simply to add "helper ''application''" to comatose_admin_controller.rb Perhaps there has been a change in rails that means that application_helper is not available to plugins without declaration? -- Posted via http://www.ruby-forum.com/.