提交 d4e35666 编写于 作者: R Rick Olson

Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 f7c916ec
*SVN*
* Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]
* Added block-usage to PrototypeHelper#form_remote_tag, document block-usage of FormTagHelper#form_tag [Rick]
* Add a 0 margin/padding div around the hidden _method input tag that form_tag outputs. [Rick]
......
......@@ -63,6 +63,8 @@ def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block)
def end_form_tag
"</form>"
end
deprecate :end_form_tag, :start_form_tag
# Creates a dropdown selection box, or if the <tt>:multiple</tt> option is set to true, a multiple
# choice selection box.
......
......@@ -142,3 +142,31 @@ def test_pass
end
end
class DeprecatedFormTagHelperTest < Test::Unit::TestCase
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::TagHelper
include ActionView::Helpers::FormTagHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::CaptureHelper
def setup
@controller = Class.new do
def url_for(options, *parameters_for_method_reference)
"http://www.example.com"
end
end
@controller = @controller.new
end
def test_start_form_tag_deprecation
assert_deprecated /start_form_tag/ do
start_form_tag
end
end
def test_end_form_tag_deprecation
assert_deprecated /end_form_tag/ do
end_form_tag
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册