%form#asset-insert{:action => "#{packet.route_to(model_name, 'new')}", :method => 'post', :enctype=>"multipart/form-data"} %input{:type => 'hidden', :name => "fake_xhr", :value => "1"} - for prop in props - next if [:path, :secondary_path].include?(prop[:name]) %p= view_attribute(prop, model_name, :label => true) %p %label File %br %input{:type => 'file', :name => "#{model_name}[file]"} / %p / %label Secondary File / %br / %input{:type => 'file', :name => "#{model_name}[file2]"} %input{:type => 'submit', :value => 'Save New Item'} :javascript $("#asset-insert").ajaxForm({dataType: 'json', success: function(ret){ $.markItUp({ replaceWith: '' } ); $.fn.colorbox.close(); }});