This project is archived and is in readonly mode.

#3547 ✓invalid
morganick

form_tag_helper.rb - display:inline issue

Reported by morganick | December 7th, 2009 @ 07:04 PM

Can we please change the display: inline on the divs to display:none for the hidden fields like the authenticity_token and _method.

Since these divs are not empty they will take up vertical space equal to the current line-height. These fields will not be rendered at all and neither should the div containing them. With display:none the div will not be rendered yet the form will still send all the data in these hidden fields on upon submit.

I have edited the following lines and confirmed that it does indeed work.

Lines 453 & 456 of form_tag_helper.rb in actionpack.

Line 453:
protect_against_forgery? ? content_tag(:div, token_tag, :style => 'margin:0;padding:0;display:none') : ''

Line 456:
content_tag(:div, tag(:input, :type => "hidden", :name => "_method", :value => method) + token_tag, :style => 'margin:0;padding:0;display:none')

Since its specified inline there is no way for me to override this style.

Thanks,

Nick

Comments and changes to this ticket

  • Rohit Arondekar

    Rohit Arondekar June 26th, 2010 @ 03:01 PM

    • State changed from “new” to “invalid”
    • Importance changed from “” to “Low”

    I don't think this causes any problems any more. I've taken a look at a few Rails apps and the div containing hidden elements doesn't occupy any space. Maybe browsers have improved over time?

    If anybody can notice this even now, maybe this can be opened for discussion but for now I'm closing this ticket.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages