You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
752 B
18 lines
752 B
13 years ago
|
<%# diferentiate create/update subform columns %>
|
||
|
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<%
|
||
|
readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update))
|
||
|
crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
|
||
|
config = active_scaffold_config_for(record.class)
|
||
|
columns = @record.new_record? ? config.create.columns : config.update.columns
|
||
|
columns.each :for => record.class, :crud_type => crud_type, :flatten => true do |column|
|
||
|
hidden = column_renders_as(column) == :hidden
|
||
|
next unless in_subform?(column, parent_record)
|
||
|
-%>
|
||
|
<th class="<%= "#{'required' if column.required?} #{'hidden' if hidden}" %>"><label><%= column.label unless hidden %></label></th>
|
||
|
<% end -%>
|
||
|
</tr>
|
||
|
</thead>
|