paperclip - Image replacing using upload preview in rails -


I am using paperclip in my project. The image is being shown as editing, but I want to change that uploaded image instead of the new image.

Try this script:

  function readURL (input) {If (input.files and input.files [0]) {var reader = new FileReader (); Reader.onload = function (e) {$ ('# my_image') .attr ('src', e.target.result). With (100) .high (100); }; reader.readAsDataURL (input.files [0]); }}    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -