views:

28

answers:

1

Hi!

I want to reformat some helpers in my Rails views. I want to archieve a syntax similar to:

<%=
box :option => 'value' do |b|
   b.header "Header of box #1"
   %>
   Content of Box#1
   <%
end
%>

The b.header call is optional.

How would I structure my code to allow this? I guess it's something similar to fields_for in Rails.

Thanks!

A: 

You could always look at the source for form_for / fields_for?

Omar Qureshi
Good point, but I'm having a hard time deciphering the source code :-)
Mattias