-if @attachment.errors.any? #errorExplanation %h2= "#{pluralize(@attachment.errors.count, "error")} prohibited this image from being saved:" %ul - @attachment.errors.full_messages.each do |msg| %li= msg = form_for [@page, Attachment.new(:page=>@page)], :remote=>true, :html=>{:multipart=>true, :id=>"upload_form"} do |f| = f.file_field :file, :id=>"file_input" = f.hidden_field :file_file_name, :id=>"file_file_name_input" = f.hidden_field :file_file_size, :id=>"file_file_size_input" = f.hidden_field :file_content_type, :id=>"file_content_type_input" = f.hidden_field :file_updated_at, :id=>"file_updated_at_input" = f.submit "Upload File", :id=>"upload_button" = content_for :head do = javascript_include_tag *%w(swfobject jquery.uploadify) :javascript $(function(){ $('#upload_button').hide(); }); = uploadify_s3(:file_input_selector => '#file_input', :button_text => 'Add File', | :on_success => %(function(f) {submitFileForm(f.name, f.size, f.type)}), | :on_error => %(function(type, text) {alert("Problem during file upload type: " + type + " text: " + text);}))