The path to routing hell in rails is paved with the usage of any links or redirects that don't use the
{:controller => foo_controller, :action => foo}
syntax.
url_for is heinously broken if your application is running on a subdomain, as are the more concise text routes.
That's actually not strictly accurate: there are application routing schemes for which url_for will not be broken. if all of your urls look like
some_site.com/subdomain/thing
you'll be fine.
if you have some_site.com/subdomain/thing/foo
the urls generated by url_for will have /thing prepended, which is 7 kinds of not good.
If it was /subdomain/thing, you'd be fine. Probably.
The additional advantage of avoiding routing hell by using the {} options is that it will tend to keep your config/routes.rb very minimalist.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment