Problem integrating Comatose with existent layout

1 view
Skip to first unread message

Daniel Cadenas

unread,
May 25, 2009, 5:38:43 PM5/25/09
to Comatose Plugin
I'm trying to integrate Comatose into a big Rails app I'm working on.
I'd like to use my current layout which has dependencies to methods in
app/controllers/application.rb
The problem is that it seems that Comatose runs in it's own space and
it cannot see these methods.
What should I do? I'm running the Comatose version found on
http://github.com/darthapo/comatose
Help!!

bilson

unread,
May 25, 2009, 6:09:25 PM5/25/09
to Comatose Plugin
Daniel:
I assume you have some sort of authentication logic in application
controller? If so, move these methods to a separate module. Below is
a basic example. Also, check out this page -
http://comatose.rubyforge.org/getting-started-03.html (under
"Authentication") for how to make use of this.

lib/cadenas_auth.rb

module CadenasAuth
protected
...your methods...
end

app/controllers/application_controller.rb

class ApplicationController < ActionController::Base
include CadenasAuth
end

Best Regards,
David Baldwin
Reply all
Reply to author
Forward
0 new messages