You can use Rails.application.routes.url_helpers
Rails.application.routes.url_helpers.users_path
For * _url versions you will need to inform the host about this or set it as default
specify host:
Rails.application.routes.url_helpers.users_url(:host => 'http://example.com')
set default value:
Example::Application.configure do routes.default_url_options = {:host => 'http://example.com'} end
source share