Javascript Rails 3.2.1

I'm looking to set this up:

So I created a file called upload.js in my assets/javascript directory with the applicable js code (on the above site). I added in the new.html.erb the html code.

The view populates but the Javascript is not working properly. I have upload.js included in my application.html.erb file. Why might this be?