Skip to content

Commit

Permalink
Correct documentation on url_for. It doesn't call to_s, but rather to…
Browse files Browse the repository at this point in the history
…_param
  • Loading branch information
radar committed Apr 5, 2011
1 parent cf07da0 commit 3575782
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actionpack/lib/action_view/helpers/url_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ def url_options
# # => /workshops # # => /workshops
# #
# <%= url_for(@workshop) %> # <%= url_for(@workshop) %>
# # calls @workshop.to_s # # calls @workshop.to_param which by default returns the id
# # => /workshops/5 # # => /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") %> # <%= url_for("http://www.example.com") %>
# # => http://www.example.com # # => http://www.example.com
# #
Expand Down

0 comments on commit 3575782

Please sign in to comment.