aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-03-27 14:04:06 +0000
committerRick Olson <technoweenie@gmail.com>2007-03-27 14:04:06 +0000
commit2a305949d756c054cee349c1ef3b39c6cf1496f8 (patch)
tree6de4aa3106b92e128a6b62dae9938b73a1f7ed03 /actionpack/lib/action_controller
parent4b78a2a245cb69e958e3d62d4c0e6fcab2eb3e76 (diff)
downloadrails-2a305949d756c054cee349c1ef3b39c6cf1496f8.tar.gz
rails-2a305949d756c054cee349c1ef3b39c6cf1496f8.tar.bz2
rails-2a305949d756c054cee349c1ef3b39c6cf1496f8.zip
documentation project patches, closes #7342, #7319, #7316, #7190 [jeremymcanally]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/assertions/dom_assertions.rb4
-rw-r--r--actionpack/lib/action_controller/assertions/model_assertions.rb2
-rw-r--r--actionpack/lib/action_controller/assertions/response_assertions.rb2
-rw-r--r--actionpack/lib/action_controller/assertions/routing_assertions.rb1
-rw-r--r--actionpack/lib/action_controller/mime_types.rb3
-rw-r--r--actionpack/lib/action_controller/url_rewriter.rb2
6 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/assertions/dom_assertions.rb b/actionpack/lib/action_controller/assertions/dom_assertions.rb
index d1eea59ea0..355080fe54 100644
--- a/actionpack/lib/action_controller/assertions/dom_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/dom_assertions.rb
@@ -1,7 +1,7 @@
module ActionController
module Assertions
module DomAssertions
- # test 2 html strings to be equivalent, i.e. identical up to reordering of attributes
+ # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes)
def assert_dom_equal(expected, actual, message="")
clean_backtrace do
expected_dom = HTML::Document.new(expected).root
@@ -11,7 +11,7 @@ module ActionController
end
end
- # negated form of +assert_dom_equivalent+
+ # The negated form of +assert_dom_equivalent+.
def assert_dom_not_equal(expected, actual, message="")
clean_backtrace do
expected_dom = HTML::Document.new(expected).root
diff --git a/actionpack/lib/action_controller/assertions/model_assertions.rb b/actionpack/lib/action_controller/assertions/model_assertions.rb
index a9bcd7db9a..5fc5c81cb7 100644
--- a/actionpack/lib/action_controller/assertions/model_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/model_assertions.rb
@@ -1,7 +1,7 @@
module ActionController
module Assertions
module ModelAssertions
- # ensures that the passed record is valid by active record standards. returns the error messages if not
+ # Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not.
def assert_valid(record)
clean_backtrace do
assert record.valid?, record.errors.full_messages.join("\n")
diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb
index cf30569f36..de7efd0ac9 100644
--- a/actionpack/lib/action_controller/assertions/response_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -119,6 +119,7 @@ module ActionController
end
private
+ # Recognizes the route for a given path.
def recognized_request_for(path, request_method = nil)
path = "/#{path}" unless path.first == '/'
@@ -131,6 +132,7 @@ module ActionController
request
end
+ # Proxy to to_param if the object will respond to it.
def parameterize(value)
value.respond_to?(:to_param) ? value.to_param : value
end
diff --git a/actionpack/lib/action_controller/assertions/routing_assertions.rb b/actionpack/lib/action_controller/assertions/routing_assertions.rb
index 11a649c49a..6cd4d48b9e 100644
--- a/actionpack/lib/action_controller/assertions/routing_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/routing_assertions.rb
@@ -82,6 +82,7 @@ module ActionController
end
private
+ # Recognizes the route for a given path.
def recognized_request_for(path, request_method = nil)
path = "/#{path}" unless path.first == '/'
diff --git a/actionpack/lib/action_controller/mime_types.rb b/actionpack/lib/action_controller/mime_types.rb
index 66a3133c4f..8273a2403b 100644
--- a/actionpack/lib/action_controller/mime_types.rb
+++ b/actionpack/lib/action_controller/mime_types.rb
@@ -1,3 +1,6 @@
+# Build list of Mime types for HTTP responses
+# http://www.iana.org/assignments/media-types/
+
Mime::Type.register "*/*", :all
Mime::Type.register "text/plain", :text, [], %w(txt)
Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml )
diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb
index 66b77e405f..88c7afff41 100644
--- a/actionpack/lib/action_controller/url_rewriter.rb
+++ b/actionpack/lib/action_controller/url_rewriter.rb
@@ -75,6 +75,7 @@ module ActionController
alias_method :to_s, :to_str
private
+ # Given a path and options, returns a rewritten URL string
def rewrite_url(options)
rewritten_url = ""
@@ -94,6 +95,7 @@ module ActionController
rewritten_url
end
+ # Given a Hash of options, generates a route
def rewrite_path(options)
options = options.symbolize_keys
options.update(options[:params].symbolize_keys) if options[:params]