<% unless @skip %>
<%= h(@object._presentation) -%>
<% end %> <% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%> <% attributes.each do | attribute, name, form_element | -%> <% 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 == :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 } %>
<% 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 -%>