adds javascript to post to rails app