Comatose::Controller should be child of ActionController::Base::ApplicationController?

3 views
Skip to first unread message

derek73

unread,
Apr 6, 2008, 5:26:27 PM4/6/08
to Comatose Plugin
I was having trouble getting my comatose pages to make use of methods
I had in a lib file. I know there's a configuration option to
including helpers and includes and that works fine for my admin
section but for some reason it doesn't work with the public pages.

I make the comatose controller a child of my application controller
instead of just ActionController::Base. Isn't that a better solution
than the config option anyway?

module Comatose
class Controller < ActionController::Base::ApplicationController


- Derek

derek73

unread,
Apr 6, 2008, 5:43:43 PM4/6/08
to Comatose Plugin
nevermind, i don't think it works. I keep getting a Superclass
Mismatch Error that I can't track down.

Baldur Gudbjornsson

unread,
Apr 6, 2008, 6:29:03 PM4/6/08
to comatos...@googlegroups.com
I remember needing the same and going down the same path you are on
(Comatose 0.8, Rails 1.2.3)... I don't remember too well what I did to
solved this exactly but basically the superclass mismatch suggest
that class load error.

One thing I did was to add
+ Dependencies.load_once_paths.delete(File.dirname(__FILE__) + '/lib')
to vendor/plugins/comatose/init.rb and I commented out the following lines in

vendor/plugins/comatose/lib/comatose.rb
- load "#{base}/comatose/admin_controller.rb"
- load "#{base}/comatose/admin_helper.rb"
- load "#{base}/comatose/controller.rb"

This was really hacky and dirty and worked sort of ... if you are
patching files in the plugin it can be very frustrating since you have
to restart the server in dev mode for the changes to take affect ...
so this comes at a cost ;)

Hope this gets you on the right track.
Baldur

Thibaut Barrère

unread,
Apr 7, 2008, 3:10:57 AM4/7/08
to comatos...@googlegroups.com
Hello Derek,


I was having trouble getting my comatose pages to make use of methods
I had in a lib file. I know there's a configuration option to
including helpers and includes and that works fine for my admin
section but for some reason it doesn't work with the public pages.

 Just to be sure; did you actually use the following syntax ? :

Comatose.configure do |comatose|
  comatose.admin_includes << :authenticated_system
  comatose.admin_authorization = :login_required
  comatose.includes << :customer_tracking_system
  comatose.authorization = :customer_required
end

(admin_x for admin parts, no admin_ prefix for public pages).

hope this helps

-- Thibaut
Reply all
Reply to author
Forward
0 new messages