rails/rails — Issue #4541: Changing how routes work
Author: jlebrech
Created: 2012-01-19 16:58:24+00:00
State: open

In rails 4 would there be any way to remove the need to write a routes.rb file?

For example a way to do this would be to have something like this in a controller or in a model

routed :path => "author"

or something like this

routed :path => "books", :via => [:author,:genre]

this would enable urls such as; `/author/1/books/1` and `/genre/horror/1` from within the controller itself.

and the running the server would generate a routes.rb in a similar way that migrations work.