mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Correct documentation on url_for. It doesn't call to_s, but rather to_param
This commit is contained in:
@@ -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
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user