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_for silently failing with rails 3.0.0

#5493

Worked fine as of master around 7:00 PM EST and with 3.1.0.beta off master as well.

Reported by Christopher Meiklejohn · August 30th, 2010 @ 04:09 AM

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

Activity

  1. Christopher Meiklejohn
    Christopher Meiklejohn

    As far as I can tell, the form is just not appearing. No deprecation warnings in the logs.

    August 30th, 2010 @ 04:09 AM

  2. Christopher Meiklejohn
    Christopher Meiklejohn

    This is with an explicit require to rails 3.0.0 in the Gemfile. Let me know what other info I can provide.

    August 30th, 2010 @ 04:12 AM

  3. Fred Wu
    Fred Wu

    When using HAML as the template engine, I got the following error:

    form_for outputs directly to the Haml template.
    Disregard its return value and use the - operator,
    or use capture_haml to get the value as a String.
    

    It worked fine on the old rails 3-0-stable branch, but now it breaks on both 3-0-stable and 3.0.0 release. Master branch is still fine. I haven't gotten time to perform a diagnose yet, so I'm just pasting the error output here for reference.

    August 30th, 2010 @ 04:20 AM

  4. Matthias Schmidt (Wolax)
    Matthias Schmidt (Wolax)

    Same here. Form just doesn't render. No warning, no error, nothing!

    August 30th, 2010 @ 05:02 AM

  5. Matthias Schmidt (Wolax)
    Matthias Schmidt (Wolax)

    Problem occurs as soon as haml is added to the Gemfile.

    To reproduce:
    new rails project with simple scaffold -> works
    add "gem 'haml'" to Gemfile -> form_for fails silently

    August 30th, 2010 @ 05:12 AM

  6. Christopher Meiklejohn
  7. Christopher Meiklejohn
    Christopher Meiklejohn

    Nice wolax. Posted here: http://github.com/nex3/haml/issues/issue/249

    Still not sure why master is fine.

    August 30th, 2010 @ 05:16 AM

  8. cdmwebs
  9. Hugo Peixoto
    Hugo Peixoto

    Confirmed Wolax's described behaviour

    August 30th, 2010 @ 05:28 AM

  10. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to duplicate
    • Importance changed from to Low

    Looks like HAML will need to resolve this.

    August 30th, 2010 @ 05:36 AM

  11. Hugo Peixoto
    Hugo Peixoto

    Found the potential source of the problem.

    It seems like a bad case of copy-pasta gone wrong in the haml gem; the form_for method is defined twice, and the latter seems to be outdated.
    Removing the latter definition makes everything work again (as far as I can tell) in both erb and haml templates.

    (Attaching the diff file that fixes it)

    August 30th, 2010 @ 05:40 AM

  12. nex3
    nex3

    I just got home, and I'm now looking into this. I hope to release Haml 3.0.18 with a fix some time tonight.

    August 30th, 2010 @ 05:43 AM

  13. nex3
    nex3

    This has been fixed by http://github.com/nex3/haml/commit/61a1de3ff75e98e92688f9dd2d121a3c.... The fix is released as part of Haml 3.0.18.

    August 30th, 2010 @ 06:44 AM