From b7fec09eb3811c8f79fa4d660572a38c4eecce69 Mon Sep 17 00:00:00 2001 From: Lars Smit Date: Thu, 10 Feb 2011 13:45:14 +0100 Subject: [PATCH] [PATCH] Ticket#5901: Extract the inline style on the authenticity_token wrapper --- actionpack/lib/action_view/helpers/form_helper.rb | 6 +++--- .../lib/action_view/helpers/form_tag_helper.rb | 2 +- actionpack/test/template/form_helper_test.rb | 2 +- actionpack/test/template/form_tag_helper_test.rb | 2 +- railties/guides/source/form_helpers.textile | 6 +++--- .../rails/stylesheets/templates/scaffold.css | 7 +++++++ 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index befaa3e..91ca784 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -38,7 +38,7 @@ module ActionView # The HTML generated for this would be (modulus formatting): # #
- #
+ #
# #
# : @@ -68,7 +68,7 @@ module ActionView # the code above as is would yield instead: # # - #
+ #
# # #
@@ -256,7 +256,7 @@ module ActionView # The HTML generated for this would be: # # - #
+ #
# #
# ... diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index d6b7497..1040508 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -617,7 +617,7 @@ module ActionView end tags = snowman_tag << method_tag - content_tag(:div, tags, :style => 'margin:0;padding:0;display:inline') + content_tag(:div, tags, :class => 'snowman_and_authenticity_wrapper') end def form_tag_html(html_options) diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index b3220d6..37a42ca 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -1631,7 +1631,7 @@ class FormHelperTest < ActionView::TestCase end def snowman(method = nil) - txt = %{
} + txt = %{
} txt << %{} if (method && !['get','post'].include?(method.to_s)) txt << %{} diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 4a584b8..5f6dd2d 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -11,7 +11,7 @@ class FormTagHelperTest < ActionView::TestCase def snowman(options = {}) method = options[:method] - txt = %{
} + txt = %{
} txt << %{} if (method && !['get','post'].include?(method.to_s)) txt << %{} diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile index 40db430..28df212 100644 --- a/railties/guides/source/form_helpers.textile +++ b/railties/guides/source/form_helpers.textile @@ -33,8 +33,8 @@ Sample output from +form_tag+: -
- +
+
Form contents @@ -343,7 +343,7 @@ output: -
+
diff --git a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css index 1ae7000..8e5f9e5 100644 --- a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css +++ b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css @@ -54,3 +54,10 @@ div.field, div.actions { font-size: 12px; list-style: square; } + +.snowman_and_authenticity_wrapper { + margin: 0; + padding: 0; + display: inline; +} + -- 1.6.4.2