merged together using angular and rails methods