public
Description: Automatically create Radiant layouts based on HTML files in other extensions
Homepage:
Clone URL: git://github.com/freelancing-god/radiant-layout-layer.git
radiant-layout-layer / layout_layer_extension.rb
100644 17 lines (14 sloc) 0.513 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'action_controller/dispatcher'
require 'layout_layer'
 
class LayoutLayerExtension < Radiant::Extension
  version "1.1"
  description "Automatically create layouts and snippets based on HTML files in other extensions"
  url "http://github.com/freelancing-god/radiant-layout-layer"
  
  def activate
    return unless ActiveRecord::Base.connection.tables.include?("layouts")
    
    ActionController::Dispatcher.to_prepare :layout_layer do
      LayoutLayer.lay
      Radiant::Cache.clear
    end
  end
end