RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: tab
Hice! Thx, but I have error "NoMethodError in ClientsController#update undefined method `eq' for nil:NilClass"
def update @client = Client.find(params[:id]) respond_to do |format| if @client.update_attributes(params[:client]) format.html { redirect_to(@client, :notice => 'Client was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @client.errors, :status => :unprocessable_entity } end end end
Hice! Thx, but I have error "NoMethodError in ClientsController#update undefined method `eq' for nil:NilClass"
def update
@client = Client.find(params[:id])
respond_to do |format|
if @client.update_attributes(params[:client])
format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @client.errors, :status => :unprocessable_entity }
end
end
end