From 50c96f23df12d18e6f6e33673b80754c8bea8866 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 4 May 2008 23:12:58 +0200 Subject: revised some conventions in polymorphic_routes.rb --- actionpack/lib/action_controller/polymorphic_routes.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'actionpack') 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 - # * :action -- specifies the action prefix for the named route: - # :new, :edit or :formatted. Default is no prefix. - # * :routing_type -- :path or :url (default :url). + # + # * :action - Specifies the action prefix for the named route: + # :new, :edit, or :formatted. Default is no prefix. + # * :routing_type - Allowed values are :path or :url. + # Default is :url. # # ==== 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) -- cgit v1.2.3