I just added a module to the SiteController the other day for the
first time (thanks Cribbs). I overwrite one of the methods actually.
Here is a sample of my module:
module TunaSiteOverride
def self.included(base)
base.class_eval do
alias_method_chain :show_page, :tuna_site_override
end
end
def show_page_with_ tuna_site_override
# Code in here
end
end
And here is my extension:
class TunaExtension < Radiant::Extension
def activate
SiteController.send :include, TunaSiteOverride
end
end
What are the exact errors you are getting? I am curious as to where
it is failing in the SiteController. As for what is new in 0.6.6, no
clue. I am JUST starting to hack into it :)
On Sat, May 10, 2008 at 12:50 PM, Chris Parrish
<[EMAIL PROTECTED]> wrote:
> Ok, I've got a weird one here. In an extension, I'm attempting to add a
> method or two to SiteController. I do this in the extension activate method
> like:
>
> def activate
> SiteController.send :include, SiteControllerMods
> end
>
> Then, in /lib/site_controller_mods.rb I define a module to add methods,
> like:
>
> module SiteControllerMods
> end
>
> Even without adding any methods, Radiant doesn't like this -- the built-in
> SiteController specs start to fail left and right. I've used this approach
> in the past and it worked just fine -- what changed with 0.6.6?
>
> Could this be something to do with Rails 2.0? Or maybe a conflict with
> rSpec?
>
> Is there a better approach?
>
> -Chris
> _______________________________________________
> Radiant mailing list
> Post: [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site: http://lists.radiantcms.org/mailman/listinfo/radiant
>
--
\m/^.^\m/
"Some scientists claim that hydrogen,
because it is so plentiful, is the basic building block of the universe.
I dispute that.
I say that there is more stupidity than hydrogen,
and that is the basic building block of the universe."
-Frank Zappa
_______________________________________________
Radiant mailing list
Post: [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site: http://lists.radiantcms.org/mailman/listinfo/radiant