Skip to content
Experimental, minimal templating engine inspired by Markaby & Erector but much smaller and targeting Rails 3
Ruby
Find file
Pull request Compare This branch is 7 commits ahead, 53 commits behind svenfuchs:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.textile
Rakefile
minimal.gemspec

README.textile

Minimal::Template is an experimental, minimalistic templating engine inspired by Markaby & Erector but much smaller (~60 loc) and targeted at Rails 3.

# views/foo/bar.rb
module Foo
  class Bar < Minimal::Template
    def content
      html do
        head
        body do
          h1 'plain'
          p  local
        end
      end
    end
  end
end

# somewhere else
view = ActionView::Base.new('path/to/your/views')
view.render(:file => 'foo/bar', :locals => { :local => 'local' })

# => '<html><head></head><body><h1>plain</h1><p>local</p></body></html>'
Something went wrong with that request. Please try again.