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.

Factor out hardcoded style in form div wrapping hidden inputs

#4561

In most circumstances, form_tag generates a

with style="margin:0;padding:0;display:inline". Using the style attribute isn't great, because the style cannot be overridden from CSS. This is a real problem for me, it's preventing me from using the CSS 3 flexible box support in Firefox.

The solution I propose is as follows: factor out the

generation into a public method in FormTagHelper, and call that method from form_tag. This way, a plugin can safely override that method to render something like
. This approach does not break existing applications.

Reported by Victor Costan · May 9th, 2010 @ 09:25 AM

State: wontfix
Milestone: none
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: Low

Activity

  1. Victor Costan
    Victor Costan

    Patch containing code and tests. Applies cleanly against Rails 3 edge. The method name (hidden_field_wrapper_tag) might not be the best option, I can change it to whatever people think would work.

    May 9th, 2010 @ 09:34 AM

  2. Victor Costan
    Victor Costan
    • Tag changed from actionview, rails3 to actionview, patch, rails3

    May 9th, 2010 @ 09:47 AM

  3. Dan Pickett
    Dan Pickett
    • Tag changed from actionview, patch, rails3 to actionview, bugmash, patch, rails3

    May 9th, 2010 @ 05:50 PM

  4. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    +1

    Applies to master cleanly and tests pass. Looks a lot cleaner. :)

    May 15th, 2010 @ 02:54 PM

  5. Anil Wadghule
  6. PacoGuzman
    PacoGuzman

    +1 All test pass, looks fine

    May 15th, 2010 @ 04:14 PM

  7. Casey Dreier
    Casey Dreier

    +1 No problems applying patch. All tests pass.

    May 15th, 2010 @ 05:18 PM

  8. Wijnand Wiersma
  9. Santiago Pastorino
    Santiago Pastorino

    I know that naming are one of the most difficult things in programming but def test doesn't seem to be right :), make an effort, don't be lazy like me :P

    May 15th, 2010 @ 10:38 PM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to wontfix

    Sorry this is not going to be fixed, don't worth changing the API for this, you can MonkeyPatch, thanks.

    May 16th, 2010 @ 12:08 AM

  11. Victor Costan
    Victor Costan
    • Assigned user set to Santiago Pastorino

    I thought that Rails 3 is trying to move towards having a clean API for plugins.

    I'm sorry for "def test"... I did that patch at 5am... I have no other explanation for how that got in there! I totally meant test_hidden_field_wrapper_tag!

    Can you please reconsider if I send in an updated patch?

    May 16th, 2010 @ 12:36 AM

  12. Victor Costan