This project is archived and is in readonly mode.
ActiveResource generates an error for a form_for attribute
-
Conrad Taylor
I was able to resolve this issue by doing the following:
... # GET /products/new # GET /products/new.xml def new @store = Product.new( :name => '', :price => 0.0 ) respond_to do |format| format.html # new.html.erb format.xml { render :xml => @product } end end ...However, should it be really necessary to declare which arguments you're going to use?
-Conrad
-
Conrad Taylor
The above line should be as follows:
@product = Product.new( :name => '', :price => 0.0 ) -
Matthew Parker
- Tag changed from 2.3.5, activeresource to 2, activeresource
i created a gem called "fortify" after running into this exact problem: http://github.com/moonmaster9000/fortify
-
Gaël Deest
- Tag changed from 2, activeresource to 2, activeresource, patch
Just made a patch to fix this. This patch makes it possible to use new active resources with form_for, using:
Product.buildinstead of:
Product.newHope this helps.
-
Gaël Deest
- Tag changed from 2, activeresource, patch to 2, 3.0.0.beta, activeresource, patch
-
Repository
- State changed from new to resolved
(from [753304bd113d7524f6d48d220483a2723c534557]) Makes ActiveResource work with form_for: - Adds a
build' method that can be used instead ofnew' to load a new, unsaved resource from the remote site, filled with the correct default values. - Adds apersisted?' method that simply returns the opposite value than thenew?' method. [#4222 Using form_for with ActiveResource broken in edge state:resolved] [#4155 ActiveResource generates an error for a form_for attribute state:resolved]Signed-off-by: wycats wycats@gmail.com
http://github.com/rails/rails/commit/753304bd113d7524f6d48d220483a2... -
Andrea Campi
- Tag changed from 2, 3.0.0.beta, activeresource, patch to 2-3-stable, 3.0.0.beta, activeresource, patch
