jquery bug fixes / refactoring jquery + erb/routes