Displaying 1 result from an estimated 1 matches for "box_data".
Did you mean:
b_data
2005 Jun 29
2
Complex helper with block help
...I am writing a helper function that takes a parameter and block and
wraps some HTML around it. e.g.
def box_with_caption(caption, &block)
data = capture(&block)
buffer = render_partial("helpers/box_caption", :caption =>
caption)
buffer << render_partial("helpers/box_data", :data => data)
buffer
end
however, when I attempt the following, it doesn''t work.
<%= box_with_caption("Caption here") do %>
HTML for the box in here.
<% end %>
To make this work I need to do something like:
<% box = box_with_caption("Caption he...