Skip to content

Commit

Permalink
Patch FormTagHelper so that when a form tag is created, the div which…
Browse files Browse the repository at this point in the history
… holds the form authenticity token is set to display:inline [#2846 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
  • Loading branch information
mcmire authored and Yehuda Katz + Carl Lerche committed Jul 2, 2009
1 parent 4d8fd8d commit 0d3c5f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -450,10 +450,10 @@ def extra_tags_for_form(html_options)
''
when /^post$/i, "", nil
html_options["method"] = "post"
protect_against_forgery? ? content_tag(:div, token_tag, :style => 'margin:0;padding:0') : ''
protect_against_forgery? ? content_tag(:div, token_tag, :style => 'margin:0;padding:0;display:inline') : ''
else
html_options["method"] = "post"
content_tag(:div, tag(:input, :type => "hidden", :name => "_method", :value => method) + token_tag, :style => 'margin:0;padding:0')
content_tag(:div, tag(:input, :type => "hidden", :name => "_method", :value => method) + token_tag, :style => 'margin:0;padding:0;display:inline')
end
end

Expand Down

1 comment on commit 0d3c5f0

@sobrinho
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'style="display: none"' is not better? This will complete hide the div tag...

Please sign in to comment.