No description or website provided.
Ruby
Latest commit d69f989 Aug 25, 2011 @judofyr More cleanup
Permalink
Failed to load latest commit information.
lib More cleanup Aug 24, 2011
test Cleanup Aug 24, 2011
README.md Get rid of `rumble do … end` Aug 24, 2011
Rakefile Initial version Jul 27, 2011
bench.rb Bench: Make sure to actually render the template Aug 24, 2011

README.md

Rumble

HTML markup in Ruby. Fast. 130 LoC. Supports CSS-proxies (see below).

Example using Draper:

class ArticleDecorator < Draper::Base
  decorates :article
  include Rumble

  def published_at
    span.published_at do
      span model.published_at.strftime("%A, %B %e").squeeze(" "), :class => 'date'
      span model.published_at.strftime("%l:%M%p").delete(" "), :class => 'time'
    end
  end
end

CSS-proxy syntax

Thanks to CSS-proxies, you can more easily define classes and ids on elements:

div.wrapper! do
  input.text.example(:name => 'username')
end

Renders as:

<div id="wrapper">
  <input class="text example" name="username">
</div>

You are of course free to use the simple syntax too:

div :id => "wrapper" do
  input :class => "text example", :name => "username"
end