js role-rails refactor