0
我想在我的Rails視圖中重新格式化一些幫助程序。我想類似的語法:在Ruby中創建嵌套塊的類
<%=
box :option => 'value' do |b|
b.header "Header of box #1"
%>
Content of Box#1
<%
end
%>
的b.header調用是可選的。
我將如何構建我的代碼來允許這個?我想這是類似於rails中的fields_for。
好點,但我很難破譯源代碼:-) – Mattias 2010-06-20 12:45:26