Skip to content

Instantly share code, notes, and snippets.

@coderberry
Created April 8, 2009 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save coderberry/91866 to your computer and use it in GitHub Desktop.
Save coderberry/91866 to your computer and use it in GitHub Desktop.
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def sheet(*args, &block)
code = <<-EOF
<table border="0" cellspacing="0" cellpadding="0" width="#{args[0]}">
<tr>
<td height="11" width="6"><img src="/images/shadow_tl.png" width="6" height="11" border="0" /></td>
<td rowspan="2" style="background-color: #fff; padding: 2px;">
#{capture(&block)}
</td>
<td height="11" width="6"><img src="/images/shadow_tr.png" width="6" height="11" border="0" /></td>
</tr>
<tr>
<td style="background: url('/images/shadow_l.png') top right repeat-y;"><img src="/images/spacer.gif" border="0" width="1" height="1" /></td>
<td style="background: url('/images/shadow_r.png') top left repeat-y;"><img src="/images/spacer.gif" border="0" width="1" height="1" /></td>
</tr>
<tr>
<td height="11"><img src="/images/shadow_bl.png" width="6" height="11" border="0" /></td>
<td style="background: url('images/shadow_b.png') top left repeat-x;"><img src="/images/spacer.gif" border="0" width="1" height="1" /></td>
<td><img src="/images/shadow_br.png" width="6" height="11" border="0" /></td>
</tr>
</table>
EOF
concat(code)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment