This project is archived and is in readonly mode.

#4222 ✓resolved
Gaël Deest

Using form_for with ActiveResource broken in edge

Reported by Gaël Deest | March 18th, 2010 @ 06:04 PM

After submitting a patch for ticket #4155 I realized that using form_for with a new instance of ActiveResource has actually been broken in edge since the following change:

Using form_for on a new ActiveResource now results in the following error:

No route matches {:action=>"destroy", :controller=>"zones", :id=>#<Zone:0x106875828 @attributes={}, @errors=#<OrderedHash {}>, @prefix_options={}>}

Full trace:

On line #4 of /users/gael/code/master/app/views/zones/_form.html.haml

    1: -unless zone.errors.empty?
    2:  .flash.errors
    3:      =error_messages_for(zone)
    4: -form_for zone do |f|
    5:  %p
    6:      =f.label :name, "Zone Name"
    7:      =f.text_field :name

    app/views/zones/_form.html.haml:4:in `_render_template_604396837_2202081640_1390988'
    app/views/zones/new.html.haml:1:in `_render_template_86870869_2202137540_0'
    app/controllers/zones_controller.rb:21:in `new'

Perhaps ActiveResource is not meant to work with RESTful helpers ?

Comments and changes to 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=""></a>

People watching this ticket


Referenced by