Newbie here, I am trying to set up Routes so that it will look up a
listing in my directory by sanitized phone number, like the following:
which will in turn list all the listings with that phone number (though
they might be in the Db table with parenthesis and hyphens), if one
listing, then make it a special render
If anyone could help with my Routes code and my controller, I would
appreciate it
unfortunately when using controllers that way, I don’t think there is
any way to setup routes any differently. perhaps someone else on the
list has some additional insight.
unfortunately when using controllers that way, I don’t think there is
any way to setup routes any differently. perhaps someone else on the
list has some additional insight.
one potential problem would be if someone tried to access an admin
route that did not exist, such as /admin/whatever’. it would not
match any of your defined admin routes and would then pass to
‘:category/:content’ which would be routed to ‘home/show’…something
to watch for. i think one additional route to catch anything else.
‘admin/:missing’ might be needed and could be routed to a 404 page or
something.
keep in mind that you’re not going to be editing routes much. so while
you might consider it ugly, it’s only in the routes.rb file and not
the rest of your code.
you might want to go one extra step and use named routes as that will
make the rest of your code a bit prettier.