So I\'m building a Rails site that needs routes based on two different types
I have a Language model and a Category model
So I need to be able to go to a la
Two routes get '/:language' and get '/:category' are exactly same for rails.
Rails router can't differentiate between /books and /ruby.
In both cases rails would just look for a route in routes.rb which looks something like /something, it will pick the first match and dispatches the route to the specified controller's action.
In your case,
all the requests with /something format
would be matched to
get '/:language', to: "top_voted#language"