public
Description: An extension for Radiant CMS that allows controllers to render their views within Radiant layouts.
Homepage:
Clone URL: git://github.com/radiant/radiant-share-layouts-extension.git
radiant-share-layouts-extension / share_layouts_extension.rb
100644 26 lines (20 sloc) 0.756 kb
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
# 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
    RailsPage
    ActionController::Base.send :include, ShareLayouts::RadiantLayouts
    ActionView::Base.send :include, ShareLayouts::Helper
  end
  
  def deactivate
  end
  
end