update: NoMethodError?

L

laredotornado

Hi,

I'm trying to update an existing model from form data, by doing

def update
# Get the subscriber corresponding to the client.
params[:form][:user_id] = session[:user_id]
@user = User.find(session[:user_id])
@form = Form.find_by_user_id(@user.id)
@form.update(params[:form])
if ([email protected]?)
flash[:notice] = "Form is invalid."
render :action => 'edit'
else
@form.save
redirect_to :controller => 'order', :action =>
'new'
end
end

but the line "@form.update(params[:form])" gives me the error

NoMethodError in FormsController#update
private method `update' called for #<Form:0xb785ef28>

I'm sure this is a syntax thing that I'm missing, but any advice you
can offer is appreciated, - Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top