diff options
author | Xavier Noria <fxn@hashref.com> | 2008-05-04 23:12:58 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2008-05-04 23:12:58 +0200 |
commit | 50c96f23df12d18e6f6e33673b80754c8bea8866 (patch) | |
tree | 71c416ffbbc37db877a93d7e08711809556e6426 | |
parent | 03e68ec80f393ee3b7ea0276b074268c90e722cf (diff) | |
download | rails-50c96f23df12d18e6f6e33673b80754c8bea8866.tar.gz rails-50c96f23df12d18e6f6e33673b80754c8bea8866.tar.bz2 rails-50c96f23df12d18e6f6e33673b80754c8bea8866.zip |
revised some conventions in polymorphic_routes.rb
-rw-r--r-- | actionpack/lib/action_controller/polymorphic_routes.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/polymorphic_routes.rb b/actionpack/lib/action_controller/polymorphic_routes.rb index aa0e05dbd7..e2b7716aa2 100644 --- a/actionpack/lib/action_controller/polymorphic_routes.rb +++ b/actionpack/lib/action_controller/polymorphic_routes.rb @@ -47,25 +47,27 @@ module ActionController # Constructs a call to a named RESTful route for the given record and returns the # resulting URL string. For example: # - # polymorphic_url(post) - # # calls post_url(post) #=> "http://example.com/posts/1" + # # calls post_url(post) + # polymorphic_url(post) # => "http://example.com/posts/1" # # ==== Options - # * <tt>:action</tt> -- specifies the action prefix for the named route: - # <tt>:new</tt>, <tt>:edit</tt> or <tt>:formatted</tt>. Default is no prefix. - # * <tt>:routing_type</tt> -- <tt>:path</tt> or <tt>:url</tt> (default <tt>:url</tt>). + # + # * <tt>:action</tt> - Specifies the action prefix for the named route: + # <tt>:new</tt>, <tt>:edit</tt>, or <tt>:formatted</tt>. Default is no prefix. + # * <tt>:routing_type</tt> - Allowed values are <tt>:path</tt> or <tt>:url</tt>. + # Default is <tt>:url</tt>. # # ==== Examples # # # an Article record - # polymorphic_url(record) #-> article_url(record) + # polymorphic_url(record) # same as article_url(record) # # # a Comment record - # polymorphic_url(record) #-> comment_url(record) + # polymorphic_url(record) # same as comment_url(record) # # # it recognizes new records and maps to the collection # record = Comment.new - # polymorphic_url(record) #-> comments_url() + # polymorphic_url(record) # same as comments_url() # def polymorphic_url(record_or_hash_or_array, options = {}) if record_or_hash_or_array.kind_of?(Array) |