Skip to content

Instantly share code, notes, and snippets.

@ihower
Created January 30, 2009 15:39
Show Gist options
  • Save ihower/55110 to your computer and use it in GitHub Desktop.
Save ihower/55110 to your computer and use it in GitHub Desktop.
# Helper
def grid_row( cols )
out = ""
cols.each do |col|
out << "<div class=\"grid_#{col[0]}\">#{col[1]}</div>"
end
return out
end
# View code
<% @foo = capture do %>
<p>foooo</p>
<% end -%>
<% @bar = capture do %>
<p>barrrr</p>
<% end -%>
<%= grid_row( [ [10,@foo], [30,@bar], [20, (render :partial => "blah") ] ] ) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment