Rails Layout Extension, release 0.3.0 (Jun. 2008)

1. simplifying content_for usage by extracting key/value pair from content_for data like YAML and setting them as content_for variables
2. let erb file can determine layout by changing the default behavior of layout determining, just like java's sitemesh
3. use controller method if helper method requested from erb not exists
4. support theme template for field tag
支持field tag的主题模板

1. rlayout as gem
put the following line into your rails initializer, or bottom of environment.rb
require 'rlayout'

2. rlayout as plugin
nothing need to do


1. simplifying content_for

<% content_for :config do %>
title: This is my title
panel: This is my panel
<% end %>

that will do the same thing as the following:

<%- content_for :title do -%>
This is my title
<%- end -%>
<%- content_for :panel do -%>
This is my panel
<%- end -%>

2. determining layout in erb file
<% content_for :config do %>
key layout won't be transferred to a content_for variable, it is only used to determine a view layout
layout: happy
<% end %>

3. use theme template of field tag

class YourController
form_theme :xhtml

and see related code in folder "example/templates", the theme can be defined in tag with :theme, that will override theme definition in controller

Copyright (c) 2008 Leon Li, released under the MIT license