Sha256: fd5dc9156275d995bed8c34f16186c27ed947fdbeffbb9e63933a27b183337cf

Contents?: true

Size: 982 Bytes

Versions: 2

Compression:

Stored size: 982 Bytes

Contents

%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){ 
    var link = $.fn.colorbox.element();
    var preview = link.prev();
    var input_name = link.attr('rel');
    preview.html(ret.html);
    $("[name*='"+input_name+"']").attr("value", ret.id);
    link.attr("href", "/admin/assets/"+ret.id+"/change");
    link.text("Change Asset");
    $.fn.colorbox.close();
  }});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
orange-sparkles-0.5.8 lib/orange-sparkles/views/assets/create.haml
orange-sparkles-0.5.7 lib/orange-sparkles/views/assets/create.haml