title: Rails and ajax file upload - cannot read property 'innerHTML' of null error
body: <p>I am developing a Rails app with a module for dynamic - ajax - image upload to gallery. I am doing it basing on <a href="https://github.com/rounders/multi-file-upload-demo/">this app - multi-file-upload-demo</a>. I am not very keen in Javascript and stuff, so I copy a lot of logic from that implementation.</p>
  
  <p>I made up my app following all logic from rounders demo, I have included all gems and javascript libraries, and I get an error:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'innerHTML' of null 
  </code></pre>
  
  <p>in chrome console, which refers to tmpl.js file</p>
  
  <pre><code>tmpl.load = function (id) {
      return document.getElementById(id).innerHTML;
  };
  </code></pre>
  
  <p>My knowledge of JS doesn't make it clear to me which piece of code triggers that function so I can go further.</p>
  
  <p>Can you advise me what are the next steps to investigate source of this problem? I expect potential reasons may be various, so I don't want to paste all code from the application.</p>