From 0d310d590c310ed6551fb38164379a2465caaa89 Mon Sep 17 00:00:00 2001 From: Diego Plentz Date: Thu, 19 May 2011 17:38:15 -0700 Subject: fixes code highlight in shallow_path example --- actionpack/lib/action_dispatch/routing/mapper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3ba6094fbb..8af4971e69 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1090,11 +1090,11 @@ module ActionDispatch # [:shallow_path] # Prefixes nested shallow routes with the specified path. # - # scope :shallow_path => "sekret" do - # resources :posts do - # resources :comments, :shallow => true + # scope :shallow_path => "sekret" do + # resources :posts do + # resources :comments, :shallow => true + # end # end - # end # # The +comments+ resource here will have the following routes generated for it: # -- cgit v1.2.3 From 023ca4fd4879f62107bcfb633d51eb57e3b6cfd7 Mon Sep 17 00:00:00 2001 From: Anuj Dutta Date: Sun, 22 May 2011 11:27:02 +0100 Subject: Fixed documentation for scope with path. --- actionpack/lib/action_dispatch/routing/mapper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 8af4971e69..860f7eced2 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -578,8 +578,8 @@ module ActionDispatch # end # # This generates helpers such as +account_projects_path+, just like +resources+ does. - # The difference here being that the routes generated are like /rails/projects/2, - # rather than /accounts/rails/projects/2. + # The difference here being that the routes generated are like /:account_id/projects, + # rather than /accounts/:account_id/projects. # # === Options # -- cgit v1.2.3 From fcdb5dc55729f4939e9a5064dfee8eef2dec4316 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 23 May 2011 20:22:33 -0300 Subject: Remove extra white spaces on ActionPack docs. --- actionpack/lib/action_dispatch/http/mime_type.rb | 4 ++-- actionpack/lib/action_dispatch/http/request.rb | 6 +++--- actionpack/lib/action_dispatch/middleware/cookies.rb | 2 +- actionpack/lib/action_dispatch/routing/mapper.rb | 2 +- actionpack/lib/action_dispatch/routing/url_for.rb | 2 +- .../lib/action_dispatch/testing/assertions/routing.rb | 18 +++++++++--------- actionpack/lib/action_dispatch/testing/integration.rb | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 7c9ebe7c7b..fa2948c8db 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -47,7 +47,7 @@ module Mime cattr_reader :html_types # These are the content types which browsers can generate without using ajax, flash, etc - # i.e. following a link, getting an image or posting a form. CSRF protection + # i.e. following a link, getting an image or posting a form. CSRF protection # only needs to protect against these types. @@browser_generated_types = Set.new [:html, :url_encoded_form, :multipart_form, :text] cattr_reader :browser_generated_types @@ -246,7 +246,7 @@ module Mime end end - # Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See + # Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See # ActionController::RequestForgeryProtection. def verify_request? @@browser_generated_types.include?(to_sym) diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index ccb866f4f7..499a272f6e 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -172,10 +172,10 @@ module ActionDispatch )\. }x - # Determines originating IP address. REMOTE_ADDR is the standard - # but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or + # Determines originating IP address. REMOTE_ADDR is the standard + # but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or # HTTP_X_FORWARDED_FOR are set by proxies so check for these if - # REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma- + # REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma- # delimited list in the case of multiple chained proxies; the last # address which is not trusted is the originating IP. def remote_ip diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 24ebb8fed7..d04780a230 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -59,7 +59,7 @@ module ActionDispatch # The option symbols for setting cookies are: # # * :value - The cookie's value or list of values (as an array). - # * :path - The path for which this cookie applies. Defaults to the root + # * :path - The path for which this cookie applies. Defaults to the root # of the application. # * :domain - The domain for which this cookie applies so you can # restrict to the domain level. If you use a schema like www.example.com diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 860f7eced2..3fac9a0d0e 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -335,7 +335,7 @@ module ActionDispatch # # [:on] # Shorthand for wrapping routes in a specific RESTful context. Valid - # values are +:member+, +:collection+, and +:new+. Only use within + # values are +:member+, +:collection+, and +:new+. Only use within # resource(s) block. For example: # # resource :bar do diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index 5893f86798..480144fe9d 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -108,7 +108,7 @@ module ActionDispatch end # Generate a url based on the options provided, default_url_options and the - # routes defined in routes.rb. The following options are supported: + # routes defined in routes.rb. The following options are supported: # # * :only_path - If true, the relative url is returned. Defaults to +false+. # * :protocol - The protocol to connect to. Defaults to 'http'. diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index b760db42e2..57a24a1bd9 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -7,18 +7,18 @@ module ActionDispatch # Suite of assertions to test routes generated by \Rails and the handling of requests made to them. module RoutingAssertions # Asserts that the routing of the given +path+ was handled correctly and that the parsed options (given in the +expected_options+ hash) - # match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+. + # match +path+. Basically, it asserts that \Rails recognizes the route given by +expected_options+. # - # Pass a hash in the second argument (+path+) to specify the request method. This is useful for routes - # requiring a specific HTTP method. The hash should contain a :path with the incoming request path + # Pass a hash in the second argument (+path+) to specify the request method. This is useful for routes + # requiring a specific HTTP method. The hash should contain a :path with the incoming request path # and a :method containing the required HTTP verb. # # # assert that POSTing to /items will call the create action on ItemsController # assert_recognizes({:controller => 'items', :action => 'create'}, {:path => 'items', :method => :post}) # - # You can also pass in +extras+ with a hash containing URL parameters that would normally be in the query string. This can be used - # to assert that values in the query string string will end up in the params hash correctly. To test query strings you must use the - # extras argument, appending the query string on the path directly will not work. For example: + # You can also pass in +extras+ with a hash containing URL parameters that would normally be in the query string. This can be used + # to assert that values in the query string string will end up in the params hash correctly. To test query strings you must use the + # extras argument, appending the query string on the path directly will not work. For example: # # # assert that a path of '/items/list/1?view=print' returns the correct options # assert_recognizes({:controller => 'items', :action => 'list', :id => '1', :view => 'print'}, 'items/list/1', { :view => "print" }) @@ -49,7 +49,7 @@ module ActionDispatch assert_equal(expected_options, request.path_parameters, msg) end - # Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+. + # Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+. # The +extras+ parameter is used to tell the request the names and values of additional request parameters that would be in # a query string. The +message+ parameter allows you to specify a custom error message for assertion failures. # @@ -92,10 +92,10 @@ module ActionDispatch end # Asserts that path and options match both ways; in other words, it verifies that path generates - # options and then that options generates path. This essentially combines +assert_recognizes+ + # options and then that options generates path. This essentially combines +assert_recognizes+ # and +assert_generates+ into one step. # - # The +extras+ hash allows you to specify options that would normally be provided as a query string to the action. The + # The +extras+ hash allows you to specify options that would normally be provided as a query string to the action. The # +message+ parameter allows you to specify a custom error message to display upon failure. # # ==== Examples diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 7d707d03a9..9791ba58e2 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -62,7 +62,7 @@ module ActionDispatch # # The request_method is +:get+, +:post+, +:put+, +:delete+ or +:head+; the # parameters are +nil+, a hash, or a url-encoded or multipart string; - # the headers are a hash. Keys are automatically upcased and prefixed + # the headers are a hash. Keys are automatically upcased and prefixed # with 'HTTP_' if not already. def xml_http_request(request_method, path, parameters = nil, headers = nil) headers ||= {} -- cgit v1.2.3