Sha256: 8796cafb90d1c401918a4b1c11f5f65385d9cbee006ecc82648951efb474347c

Contents?: true

Size: 495 Bytes

Versions: 16

Compression:

Stored size: 495 Bytes

Contents

module Kitsune
  module Page
    def self.included(model)
      model.class_eval do
        admin do
          wysiwyg :body
          select :layout, Proc.new {Dir.glob(File.join(RAILS_ROOT, 'app', 'views', 'layouts', '*.html.haml')).map{|f| File.basename(f).split('.').first}}
        end
        
        before_save :update_url
        belongs_to :page, :foreign_key => "parent_id"
        
        def update_url
          write_attribute :url, title
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kitsune-0.1.0 lib/kitsune/page.rb
kitsune-0.0.19 lib/kitsune/page.rb
kitsune-0.0.18 lib/kitsune/page.rb
kitsune-0.0.17 lib/kitsune/page.rb
kitsune-0.0.16 lib/kitsune/page.rb
kitsune-0.0.14 lib/kitsune/page.rb
kitsune-0.0.13 lib/kitsune/page.rb
kitsune-0.0.12 lib/kitsune/page.rb
kitsune-0.0.11 lib/kitsune/page.rb
kitsune-0.0.10 lib/kitsune/page.rb
kitsune-0.0.9 lib/kitsune/page.rb
kitsune-0.0.8 lib/kitsune/page.rb
kitsune-0.0.7 lib/kitsune/page.rb
kitsune-0.0.6 lib/kitsune/page.rb
kitsune-0.0.5 lib/kitsune/page.rb
kitsune-0.0.4 lib/kitsune/page.rb