1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Ryan Bigg 2011-04-05 21:22:10 +10:00
parent cf07da0929
commit 357578256f

View file

@ -81,9 +81,12 @@ module ActionView
# # => /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
#