aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2011-04-05 21:22:10 +1000
committerRyan Bigg <radarlistener@gmail.com>2011-04-05 21:22:10 +1000
commit357578256fb55e32ae87c6fbf22a1c19f59ce264 (patch)
tree817d8239d820aa4104aa07eae2656365cffddf8c /actionpack/lib/action_view/helpers
parentcf07da0929bbeaaeb68cbafbb600727b3bda470e (diff)
downloadrails-357578256fb55e32ae87c6fbf22a1c19f59ce264.tar.gz
rails-357578256fb55e32ae87c6fbf22a1c19f59ce264.tar.bz2
rails-357578256fb55e32ae87c6fbf22a1c19f59ce264.zip
Correct documentation on url_for. It doesn't call to_s, but rather to_param
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 2cd2dca711..6496397c31 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -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
#