def doRoutes(root) post root+'users/authenticate', to: 'api/users#authenticate' post root+'users/presalt', to: 'api/users#presalt' post root+'users/checkToken', to: 'api/users#checkToken' post root+'users/changePassword', to: 'api/users#changePassword' post root+'users/postStatus', to: 'api/users#postStatus' get root+'users/status', to: 'api/users#status' post root+'users/updateQuote', to: 'api/users#updateQuote' get root+'users/quotes', to: 'api/users#quotes' end Rails.application.routes.draw do root = 'api/' doRoutes("") end