# Update: NoMethodError?

**URL:** <https://www.ruby-forum.com/t/update-nomethoderror/145095>\
**Category:** Ruby\
**Created:** [August 6, 2008, 12:10am UTC](https://www.ruby-forum.com/t/update-nomethoderror/145095 "2008-08-06T00:10:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laredotornado](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9dc877/32.png) [@laredotornado](https://www.ruby-forum.com/u/laredotornado)\
**Post date:** [August 6, 2008, 12:10am UTC](https://www.ruby-forum.com/t/update-nomethoderror/145095/1 "2008-08-06T00:10:30Z")

</div>

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 (!@form.valid?)
                    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
