fix dependency issues with rails
Fix an issue where the modal wasn't being cleared resulting in double posts.