svenfuchs / Minimal
Minimal templating engine inspired by Markaby & Erector but much smaller and targeting Rails 3
Stars: ✭ 27
Programming Languages
ruby
36898 projects - #4 most used programming language
Minimal::Template
Minimal::Template is an experimental, minimalistic templating engine inspired by [Markaby]:(http://github.com/markaby/markaby) & [Erector]:(http://erector.rubyforge.org) but much smaller (~55 loc) and targeted at Rails 3.
# views/foo/bar.rb
module Foo
class Bar < Minimal::Template
def to_html
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>'</pre>
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].