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 in current rails master is broken (really)

#4195
= form_for :staticpage, :url => { :action => "update" } do |f|

outputs:

<form action="/staticpages" method="post">

the action gets stripped away.
seems to be something with the last commits, since it was working two days ago.

Reported by z3cko · March 16th, 2010 @ 08:05 PM

State: resolved
Milestone: 3.0.2
Assigned to: Carl Lerche Carl Lerche
Importance: none

Activity

  1. z3cko
    z3cko
    • Title changed from form_for in current rails master is broken (no to form_for in current rails master is broken (really)

    March 16th, 2010 @ 08:06 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to Carl Lerche

    March 16th, 2010 @ 08:18 PM

  3. z3cko
    z3cko

    i just confirmed that this issue also exists with erb, so it's definitely rails related and not haml related.

    <%= form_for(:staticpage, @page, :url => { :action => "create" }) do |f| %>
    <%= f.label :title %>
    <% end %>
    

    produces

    <form action="/staticpages" method="post">
    <label for="staticpage_title">Title</label>
    </form>
    

    March 16th, 2010 @ 09:03 PM

  4. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from open to resolved

    I can't reproduce on master.

    March 17th, 2010 @ 10:19 PM

  5. z3cko
    z3cko

    sorry, but i can reproduce this on the current master.
    nothing changed, same outcome.

    March 19th, 2010 @ 01:38 PM

  6. Denis Odorcic
    Denis Odorcic

    I can't reproduce either, just tried with a fresh app. Perhaps you have some different routes setup that are triggering this?

    March 19th, 2010 @ 02:51 PM

  7. z3cko
    z3cko

    more specific: if you are trying to override the action that was intended,
    i.e. update2 instead of update, the form_for helper does not accept the extra :url => {:action => "update2"}

    i hope the issue is more understandable now and can be reproduced.

    March 21st, 2010 @ 11:37 AM

  8. Jeremy Kemper
    Jeremy Kemper
    • State changed from resolved to open

    March 21st, 2010 @ 03:32 PM

  9. José Valim
    José Valim

    @z3cko can you please provide a failing test case in Rails test suite or isolate the issue in an application?

    March 21st, 2010 @ 06:28 PM

  10. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from open to needs-more-info

    March 29th, 2010 @ 02:47 AM

  11. Santiago Pastorino
    Santiago Pastorino
    • State changed from needs-more-info to resolved

    Works on the last version, thanks for your bug report.

    April 3rd, 2010 @ 09:58 PM

  12. Jeremy Kemper