The dangers of url_for in Rails applications

Posted . Visible to the public.

In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used.<br />
<br />
Most often we use foo_path, which when used in Rails URL helpers will generate a relative path, where foo_url generates a full URL. In most cases the path makes most sense, but not always.

Last edit
Keywords
rails
License
Source code in this card is licensed under the MIT License.
Posted by Lexy to makandra dev (2010-09-07 11:17)