used rails helpers to generate forms and populated submittable field
attach click handler using coffeescript
moved all javascript to coffeescript