<def tag="field-list" attrs="tag, show-non-editable">
<% tag ||= scope.in_form ? "input" : "view" %>
<labelled-item-list merge-attrs="&attributes -
attrs_for(:with_fields)">
<with-fields merge-attrs="&attributes & attrs_for(:with_fields)"><
% field_name = this_field_name %>
<labelled-item unless="&tag == 'input' && !can_edit? && !
show_non_editable">
<item-label param="#{this_field.to_s.sub('?', '')}-label"
unless="&field_name.blank?">
<do param="label"><%= field_name %></do>
</item-label>
<item-value param="#{this_field.to_s.sub('?', '')}-view"
colspan="&2 if field_name.blank?">
<do param="view"><call-tag tag="&tag"
param="#{this_field.to_s.sub('?', '')}-tag"/></do>
<div param="input-help" if="&tag.to_sym == :input && !
this_field_help.blank?"><%= this_field_help %></div>
</item-value>
</labelled-item>
</with-fields>
</labelled-item-list>
</def>
e.g. on an edit page
<edit-page>
<form:><field-list: show-non-editable/></form:>
</edit-page>
(not tested!)
Tom
Tom
Adding it to application.dryml would be fine. Maybe some funny stuff
happened with line-breaks when I pasted it in the email?
Tom