forked from radiant/radiant-share-layouts-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshare_layouts_extension.rb
29 lines (23 loc) · 931 Bytes
/
share_layouts_extension.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Uncomment this if you reference any of your controllers in activate
require_dependency 'application_controller'
class ShareLayoutsExtension < Radiant::Extension
version "0.3.1"
description "Allows Radiant layouts to be used as layouts for standard Rails actions."
url "http://wiki.github.com/radiant/radiant/thirdparty-extensions"
# I'm sure this can be done more elegantly, but without it, RSpec complains about routing errors
if ENV["RAILS_ENV"] == "test"
define_routes do |map|
map.connect ':controller/:action/:id'
end
end
def activate
require 'share_layouts/radiant_layouts'
require 'share_layouts/radiant_mailer_layouts'
RailsPage
ActionView::Base.send :include, ShareLayouts::Helper
ApplicationController.send :include, ShareLayouts::ControllerExtensions
Site.send :include, ShareLayouts::SiteExtensions if defined? Site
end
def deactivate
end
end