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:
parent
cf07da0929
commit
357578256f
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue