diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 11:17:25 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-12 11:17:25 +0000 |
commit | 85a5deacdc1f0d1a56a07429a03dfa0cf8cc7f78 (patch) | |
tree | b4a416b87a8a4b85c22c5a0827800f0954758eca /actionpack/lib/action_view | |
parent | 9fe6d61b848a220a91a118daea0ceb02e5f4d3aa (diff) | |
download | rails-85a5deacdc1f0d1a56a07429a03dfa0cf8cc7f78.tar.gz rails-85a5deacdc1f0d1a56a07429a03dfa0cf8cc7f78.tar.bz2 rails-85a5deacdc1f0d1a56a07429a03dfa0cf8cc7f78.zip |
Use lower-case post instead of POST as form method for XHTML compliance #290 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/active_record_helper.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/tag_helper.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb index 7066121c28..eee8b6b970 100644 --- a/actionpack/lib/action_view/helpers/active_record_helper.rb +++ b/actionpack/lib/action_view/helpers/active_record_helper.rb @@ -24,7 +24,7 @@ module ActionView # Returns an entire form with input tags and everything for a specified Active Record object. Example # (post is a new record that has a title using VARCHAR and a body using TEXT): # form("post") => - # <form action='/post/create' method='POST'> + # <form action='/post/create' method='post'> # <p> # <label for="post_title">Title</label><br /> # <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /> @@ -44,7 +44,7 @@ module ActionView # form("entry", :action => "sign", :input_block => # Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}<br />" }) => # - # <form action='/post/sign' method='POST'> + # <form action='/post/sign' method='post'> # Message: # <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /><br /> # <input type='submit' value='Sign' /> @@ -54,7 +54,7 @@ module ActionView action = url_for(:action => options[:action] || (record.new_record? ? "create" : "update")) id_field = record.new_record? ? "" : InstanceTag.new(record_name, "id", self).to_input_field_tag("hidden") - "<form action='#{action}' method='POST'>" + + "<form action='#{action}' method='post'>" + id_field + all_input_tags(record, record_name, options) + "<input type='submit' value='#{action.gsub(/[^A-Za-z]/, "").capitalize}' />" + "</form>" diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb index dc71826614..13aa9297ca 100644 --- a/actionpack/lib/action_view/helpers/tag_helper.rb +++ b/actionpack/lib/action_view/helpers/tag_helper.rb @@ -24,7 +24,7 @@ module ActionView # Starts a form tag that points the action to an url configured with <tt>url_for_options</tt> just like # ActionController::Base#url_for. def form_tag(url_for_options = {}, options = {}, *parameters_for_url) - html_options = { "method" => "POST" }.merge(options) + html_options = { "method" => "post" }.merge(options) if html_options[:multipart] html_options["enctype"] = "multipart/form-data" @@ -56,4 +56,4 @@ module ActionView end end end -end
\ No newline at end of file +end |