Where’s root_path or root_url?

These helpers exist, but you have to set your root url before, in config/routes.rb:

root :to => "controller#action"

You can use root_url and root_path afterwards.

Be warned that there’s a catch when doing redirections with the _path helpers, you should use the _url ones when redirecting (see @LanguagesNamedAfterCoffee’s comment for the details).

Leave a Comment

File not found.