Permalink
Browse files

Correct documentation on url_for. It doesn't call to_s, but rather to…

…_param
  • Loading branch information...
1 parent cf07da0 commit 357578256fb55e32ae87c6fbf22a1c19f59ce264 @radar radar committed Apr 5, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 actionpack/lib/action_view/helpers/url_helper.rb
View
5 actionpack/lib/action_view/helpers/url_helper.rb
@@ -81,9 +81,12 @@ def url_options
# # => /workshops
#
# <%= url_for(@workshop) %>
- # # calls @workshop.to_s
+ # # calls @workshop.to_param which by default returns the id
# # => /workshops/5
#
+ # # to_param can be re-defined in a model to provide different URL names:
+ # # => /workshops/1-workshop-name
+ #
# <%= url_for("http://www.example.com") %>
# # => http://www.example.com
#

0 comments on commit 3575782

Please sign in to comment.