Sha256: 1092fda69d741c8e1f898622f7c7a215028e959a3ee4171fc160516320828e4e

Contents?: true

Size: 522 Bytes

Versions: 1

Compression:

Stored size: 522 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"
        belongs_to :parent
        
        def update_url
          write_attribute :url, title
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kitsune-0.1.1 lib/kitsune/page.rb