# Update and update\_attribute woes

**URL:** <https://www.ruby-forum.com/t/update-and-update-attribute-woes/135231>\
**Category:** Rails\
**Created:** [April 19, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/update-and-update-attribute-woes/135231 "2008-04-19T15:28:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rushnosh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58956e/32.png) [@rushnosh](https://www.ruby-forum.com/u/rushnosh)\
**Post date:** [April 19, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/update-and-update-attribute-woes/135231/1 "2008-04-19T15:28:32Z")

</div>

i can not get update to work via controller/server.

it works via console ???

this is what i get when i run it

Club Load (0.005893) SELECT \* FROM clubs WHERE (clubs.“id” = 3)  
SQL (0.000570) BEGIN  
SQL (0.000454) COMMIT

```
club.update_attributes(:state => "CA")

```

or

```
Club.update(3, :state => "CA")

```

what am i overlooking?

---

<div class="post-metadata">

**Author:** ![rushnosh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58956e/32.png) [@rushnosh](https://www.ruby-forum.com/u/rushnosh)\
**Post date:** [April 19, 2008, 6:51pm UTC](https://www.ruby-forum.com/t/update-and-update-attribute-woes/135231/2 "2008-04-19T18:51:45Z")

</div>

Although you neither show nor mention any errors from your log, consider  
these two points. First, AR::Base#update\_attributes returns false if the  
save fails any validations; check its return value. Second,  
AR::Base.update  
returns the object whether save is successful or not; check it by  
calling  
club.valid?. Other than that, I think you’d have to post the code that  
you’re using in the controller to update the club and the code that you  
use  
successfully in the console.  
Regards,  
Craig
