I have these two routes for static pages which I catch in the controller.
match "/pages/:page" => "pages#aboutus"
match "/pages/:page" => "pages#team"
I thought that it would work by matching the “aboutus” or the “team” but the routing seems to only be working by looking for the first entry above.
My controller looks like this:
def aboutus
end
def team
end
Any idea how I can make the routes go to the correct controller entry?
Thanks!
It can’t work like that.
What you wrote means that the request is dispatched to the
pagescontroller’saboutusaction with{ :page }in params. What is supposed to be your:page?Also, read the routing guide
If you want
/pages/aboutusto redirect topages#aboutusand/pages/team/topages#teamdo that: