This can be extracted into a javascript file in `app/assets/javascripts`