Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

form_tag_helper.rb - display:inline issue

#3547

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

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

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • 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.

    June 26th, 2010 @ 03:01 PM