stylesheet_link_tag( ‘dust_<%=parent_singular_name%>’,‘<%=parent_singular_name%>_uploadify’)

%script{:charset => “utf-8”, :type => “text/javascript”}

$(document).ready(function() {
$(function () { // this line makes sure this code runs on page load
$('.checkall').click(function () {
$(this).parents('form:eq(0)').find(':checkbox').attr('checked', this.checked);
});
});
});

#<%=child_singular_name%>list

%h1= link_to @<%=parent_singular_name%>.title, <%=parent_singular_name%>_path(@<%=parent_singular_name%>)

= form_tag '/destroy-<%=child_plural_name%>' do 

  %table{:class => "<%=child_plural_name%>"}
    %tr{:style => 'color:#222;'}
      %th
      %th
      %th
        File Name
      %th
        File Size
      %th
        Created At
      - @<%=parent_singular_name%>.<%=child_plural_name%>.each do |<%=child_singular_name%>| 
        %tr{:class => cycle('odd', 'even')}
          %td
            = check_box_tag "<%=child_singular_name%>_ids[]", <%=child_singular_name%>.id 
          %td
            =  image_tag(<%=child_singular_name%>.file.url(:thumb), :height => "60")

            %div{:style => "display:none"}
              %div{:class => <%=child_singular_name%>.id}
                = image_tag(<%=child_singular_name%>.file.url(:original))
          %td
            = <%=child_singular_name%>.file_file_name
          %td
            = number_to_human_size(<%=child_singular_name%>.file_file_size)
          %td
            = <%=child_singular_name%>.created_at.to_s(:m_d_y)
      %tr{:class => 'odd'}
        %td{ :colspan => '5'}
          = check_box_tag 'photos', 'yes', false, :class => 'checkall'
          Check all
          = submit_tag "Delete checked"