Forum: Ruby on Rails Modules, controllers and inheritance

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Łukasz Piestrzeniewicz (Guest)
on 2006-01-30 16:58
(Received via mailing list)
Hi!

I was trying to cleanup my app and I runned into quite a problem. My
controllers in submodule do not seem to inherit things from base
class.

I have following setup:

app/controllers/
  application.rb:
    class ApplicationController
  admin/
    admin_controller.rb:
      class Admin::AdminController < ApplicationController
        include LoginEngine
        include UserEngine
        before_filter :authorize_action # method defined by LoginEngine
    homepage_controller.rb
      class Admin::HomepageController < Admin::AdminController

Now when I try to access HomepageController I get NoMethodError:

undefined method `authorize_action' for
#<Admin::HomepageController:0xb77746c0>

So it seems that HomepageController properly inherits filters but not
included module contents.

Funny thing is that when I include engines from within
ApplicationController everything is a-ok.

Can someone tell me what is wrong?
James A. (Guest)
on 2006-01-30 19:50
(Received via mailing list)
I'll try and have a look at this tonight. Which version of Rails are
you running (Edge vs. 1.0?) and do you have the latest engine plugin
(or the edge branch, in the case of using Edge rails)?

- james
Łukasz Piestrzeniewicz (Guest)
on 2006-01-30 20:05
(Received via mailing list)
On 30/01/06, James A. <removed_email_address@domain.invalid> wrote:
> I'll try and have a look at this tonight. Which version of Rails are
> you running (Edge vs. 1.0?) and do you have the latest engine plugin
> (or the edge branch, in the case of using Edge rails)?

I am running stable versions of Rails and plugins, pulled using
following svn:externals:

vendor:
rails http://dev.rubyonrails.org/svn/rails/branches/stable

vendor/plugins:
engines https://opensvn.csie.org/rails_engines/plugins/engines
login_engine https://opensvn.csie.org/rails_engines/plugins/login_engine
user_engine https://opensvn.csie.org/rails_engines/plugins/user_engine

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