Using rails 4.2.1
I want to store my rails declared routes from config/routes.rb into a ruby hash that I can access or render somewhere.
The hash should be of the format
{
name: 'path',
# e.g.
login: '/login',
home: '/'
}
How do I do this in rails?
Note: I think you get the routes through Rails.application.routes and maybe the names from Rails.application.routes.routes.named_routes.keys, but what's next?
jsonobject to use on the front end to look up url strings based on route names.