% record_column = column -%>
<% readonly = (@record.readonly? or not @record.authorized_for?(:action => :update)) -%>
<% action = @record.new_record? ? :create : (readonly ? :read : nil) -%>
<% show_actions = false -%>
<% active_scaffold_config_for(@record.class).subform.columns.each :for => @record.class, :action => action, :flatten => true do |column| %>
<%
next unless in_subform?(column, parent_record)
show_actions = true
column = column.clone
column.form_ui ||= :select if column.association
-%>
<% unless readonly and not @record.new_record? -%>
<%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
<% else -%>
<%= get_column_value(@record, column) -%>
<% end -%>
|
<% end -%>
<% if show_actions -%>
<%= link_to_function as_(:remove), '$(this).up(".association-record").remove()', { :class => "destroy" } if record_column.plural_association? and (@record.authorized_for?(:action => :destroy) or not [:destroy, :delete_all].include?(record_column.association.options[:dependent])) %>
<% unless @record.new_record? %>
" value="<%= @record.id -%>" />
<% end -%>
|
<% end -%>