ace/example/app/posts.rb
Jakub Stastny aka botanicus e5fe48990d Fixed the example.
2011-05-26 12:10:16 +02:00

21 lines
322 B
Ruby

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