title: Display base64 encoded image in rails
body: <p>I'm sending a base64 image to my controller and I'm saving it as it is. 
  Now I need to display that image. 
  This is what I'm doing to display but image is not showing up:</p>
  
  <pre><code>&lt;img src="&lt;%= Base64.decode64(@data_obj.first.desc) %&gt;"/&gt;
  </code></pre>
  
  <p>In order to encode I'm using this java-script function <code>encodeURIComponent();</code></p>
  
  <p>My encoded image format:</p>
  
  <pre><code>data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/........
  </code></pre>