Pushing snippet of code to app js

Not sure if this code should be under the app js views. Putting the
code there anyways because it worked while testing with Danny’s
computer.