Sha256: e0953923cdf45d02b7daf1f6ac35a5a07e370c10ad4501d4d3d8b2665f7151d6

Contents?: true

Size: 1.88 KB

Versions: 2

Compression:

Stored size: 1.88 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)
-%>
<ol class="association-record <%= 'association-record-new' if @record.new_record? -%> <%= 'locked' if locked -%>">
<% if @record.errors.count -%>
  <div class="association-record-errors" id="<%= element_messages_id :action => @record.class.name.underscore, :id => "#{parent_record.id}-#{index}" %>">
    <%= error_messages_for :record, :object_name => @record.class.human_name.downcase %>
  </div>
<% end %>
<% config.subform.columns.each :for => @record, :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
-%>
  <li class="form-element <%= 'required' if column.required? %> <%= column.css_class unless column.css_class.nil? %>">
    <% unless readonly -%>
      <%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
    <% else -%>
      <p><%= get_column_value(@record, column) -%></p>
    <% end -%>
  </li>
<% end -%>
<% if show_actions -%>
  <li class="actions">
    <%= link_to_function as_(:remove), '$(this).up(".association-record").remove()', { :class => "destroy" } if record_column.plural_association? and (@record.authorized_for?(:crud_type => :delete) or not [:destroy, :delete_all].include?(record_column.association.options[:dependent])) %>
    <% unless @record.new_record? %>
    <% options = active_scaffold_input_options(config.columns[@record.class.primary_key], scope) -%>
    <input type="hidden" name="<%= options[:name] -%>" id="<%= options[:id] -%>" value="<%= @record.id -%>" />
    <% end -%>
  </li>
<% end -%>
</ol>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brisk-bills-0.8.2 vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform_record.html.erb
brisk-bills-0.8.1 vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform_record.html.erb