# Session updates

**URL:** <https://www.ruby-forum.com/t/session-updates/143701>\
**Category:** Rails\
**Created:** [July 22, 2008, 12:42am UTC](https://www.ruby-forum.com/t/session-updates/143701 "2008-07-22T00:42:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 22, 2008, 12:42am UTC](https://www.ruby-forum.com/t/session-updates/143701/1 "2008-07-22T00:42:55Z")

</div>

session.model.update\_attribute(:user\_id, session[:user\_id])  
session.model.update\_attribute(:requirement\_title, params[:thread])

I found this on the net. Not sure how it works. Whenever a user clicks  
on a certain link, I want to update the session’s, that corresponds to  
the user\_id, :requirement\_title.

What modifications would I have to make?

Thanks!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 22, 2008, 1:23am UTC](https://www.ruby-forum.com/t/session-updates/143701/2 "2008-07-22T01:23:58Z")

</div>

On 21 Jul 2008, at 23:42, Justin To wrote:

> session.model.update\_attribute(:user\_id, session[:user\_id])  
> session.model.update\_attribute(:requirement\_title, params[:thread])
> 
> I found this on the net. Not sure how it works. Whenever a user clicks  
> on a certain link, I want to update the session’s, that corresponds to  
> the user\_id, :requirement\_title.

The above assumes you are using active\_record\_store and is for  
modifying metadata about the session, not the session data itself  
Normally just session[:foo]=:bar will do the trick.

Fred
