<% unless @skip %>
<%= h(@object._presentation) -%>
<% end %> <% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%> <% attributes.each do | attribute, name, form_element | -%> <% puts "LOG: #{attribute}, #{form_element}" if Rails.env.development? %> <% if cancan_disabled? || can?(:read, @object, attribute) %> <% css_class_id = "#{@object.class.name.underscore}_#{@object.id}_#{attribute}" -%> <% if form_element == :header %>
<%= @object.class.human_attribute_name(attribute) -%>
<% else %> <% if form_element == :tree -%>
Children
<%= link_to_new_record(@object.class, "new_#{@object.class.to_s.underscore.singularize}_path", css_class_id, @object.class, @object.id) -%>
 
<%= render :partial => "inline_forms/tree", :locals => { :parent_class => @object.class, :parent_id => @object.id, :attribute => attribute } %>
<% else %> <% if form_element == :associated -%>
<%= @object.class.human_attribute_name(attribute) -%>
<%= link_to_new_record(attribute.to_s.singularize.camelcase.constantize, "new_#{attribute.to_s.underscore.singularize}_path", css_class_id, @object.class, @object.id) -%>
 
<%= render :partial => "inline_forms/list", :locals => { :parent_class => @object.class, :parent_id => @object.id, :attribute => attribute, :form_element => form_element } %>
<% else %> <% if form_element == :has_one %>
 
<%= render :partial => "inline_forms/list", :locals => { :parent_class => @object.class, :parent_id => @object.id, :attribute => attribute, :form_element => form_element } %>
<% else %>
<% if @object.has_validations_for?(attribute) -%> <%= @object.class.human_attribute_name(attribute) -%> <% else %> <%= @object.class.human_attribute_name(attribute) -%> <% end %>
<%= send("#{form_element}_show", @object, attribute) -%>
<% end %> <% end %> <% end %> <% end %> <% end %> <% end %>