Sha256: ab6debdf76c8c496c420d53d1b121cf56869af555e96cbb8bd9d06e1f9f1b0f0

Contents?: true

Size: 613 Bytes

Versions: 24

Compression:

Stored size: 613 Bytes

Contents

# configuration options for this briefcase
config do
  set(:models_path => Pathname(__FILE__).parent.join("models"))
end

# define a Post model
define("Post") do

  # the post model will have YAML frontmatter
  # with values for 'status' and 'date'
  meta do
    status
    date DateTime, :default => lambda {|post, attr| post.document.created_at }
  end

  # the post model will have a 'title' method which returns the text
  # from the first h1 heading
  content do
    title "h1"
    has_many :subheadings, "h2"
  end

  actions do
    def publish(options={})
      puts "The publish action"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
brief-1.8.6 examples/blog/brief.rb
brief-1.8.5 examples/blog/brief.rb
brief-1.8.4 examples/blog/brief.rb
brief-1.8.3 examples/blog/brief.rb
brief-1.8.2 examples/blog/brief.rb
brief-1.8.1 examples/blog/brief.rb
brief-1.8.0 examples/blog/brief.rb
brief-1.7.3 examples/blog/brief.rb
brief-1.7.2 examples/blog/brief.rb
brief-1.7.1 examples/blog/brief.rb
brief-1.7.0 examples/blog/brief.rb
brief-1.6.1 examples/blog/brief.rb
brief-1.6.0 examples/blog/brief.rb
brief-1.5.2 examples/blog/brief.rb
brief-1.5.1 examples/blog/brief.rb
brief-1.5.0 examples/blog/brief.rb
brief-1.4.4 examples/blog/brief.rb
brief-1.4.2 examples/blog/brief.rb
brief-1.4.1 examples/blog/brief.rb
brief-1.3.2 examples/blog/brief.rb