<% sectionable_type = section.sectionable.andand.class.to_s.demodulize.underscore %>
  • "> <% variant_form.fields_for "sections_attributes", section, :index => guid do |section_form| %> <%= section_form.hidden_field :id unless section_form.object.new_record? %> <%= section_form.hidden_field :_destroy, :class => "delete" %> <%= section_form.positioning_field %> <% section_form.fields_for "sectionable_attributes", section_form.object.sectionable do |sectionable_form| %> <%= sectionable_form.hidden_field :id unless sectionable_form.object.new_record? %> <%= sectionable_form.hidden_field :class if sectionable_form.object.new_record? %>
    <%= link_to_function button_text(:undo), "PageHelper.unDestroy('section_#{guid}')", :class => "undo button small" %> <%= t(:will_be_destroyed, :section => section.sectionable.class.human_name, :scope => [:section, :form]) %>
    <% if section.sectionable.default_interface %>
    <%= renderable_templates_select(section.sectionable, section_form) %>
    <%= section.sectionable.class.human_name %>
    <%= render :partial => "skyline/sections/#{sectionable_type}", :locals => {:section_form => section_form, :sectionable_form => sectionable_form, :guid => guid} %>
    <% else %> <%= render :partial => "skyline/sections/#{sectionable_type}", :locals => {:section_form => section_form, :sectionable_form => sectionable_form, :guid => guid} %> <% end %>
    <% end %> <% end %>
  • <%= javascript_tag "PageHelper.destroy('section_#{guid}');" if section.marked_for_destruction? %>