ace/example/app/posts.rb

21 lines
313 B
Ruby
Raw Normal View History

2010-10-20 15:42:17 +02:00
# encoding: utf-8
require "nokogiri"
require "ace/filters"
# Inheritted methods:
# - content
# - metadata
# - config
class Post < Ace::Item
before Ace::TemplateFilter, layout: "post.html"
2010-10-20 15:42:17 +02:00
def document
Nokogiri::HTML(self.content)
end
def excerpt
self.document.css("p.excerpt")
end
end