Sha256: 0e5713a8c48d80158187e38f1789ce80c099fc1e853dccb076d488fdfdd3dec7
Contents?: true
Size: 1.96 KB
Versions: 26
Compression:
Stored size: 1.96 KB
Contents
<% record_column = column readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update)) crud_type = @record.new_record? ? :create : (readonly ? :read : :update) show_actions = false config = active_scaffold_config_for(@record.class) options = active_scaffold_input_options(config.columns[@record.class.primary_key], scope) tr_id = "association-#{options[:id]}" associated_action = @record.new_record? ? :create_or_empty : :update %> <tr id="<%= tr_id %>" class="association-record <%= 'association-record-new' if @record.new_record? -%> <%= 'locked' if locked -%>"> <% config.subform.columns.each :for => @record.class, :crud_type => crud_type, :flatten => true do |column| %> <% next unless in_subform?(column, parent_record) show_actions = true column = column.clone column.form_ui ||= :select if column.association -%> <td> <% unless readonly and not @record.new_record? -%> <%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%> <% else -%> <p><%= get_column_value(@record, column) -%></p> <% end -%> </td> <% end -%> <% if show_actions -%> <td class="actions"> <% if record_column.plural_association? and (@record.authorized_for?(:crud_type => :delete) or not [:destroy, :delete_all].include?(record_column.association.options[:dependent])) %> <% link_classes = ['destroy', 'as_destroy_existing'] link_classes << 'as_associated_form_link' if !locked %> <%= link_to as_(:remove), '#', :class => link_classes.join(' '), :style=> "display: none;" %> <% end %> </td> <% end -%> <td> <% unless @record.new_record? %> <input type="hidden" name="<%= options[:name] -%>" id="<%= options[:id] -%>" value="<%= @record.id -%>" /> <% end -%> <input type="hidden" name="<%= scope ? "record#{scope}[associated_action]" : "record[associated_action]" -%>" class="associated_action" value="<%= associated_action -%>" /> </td> </tr>
Version data entries
26 entries across 26 versions & 1 rubygems