views:

34

answers:

1

How do you store a cookie with basic info.

i.e. link is http://www.domain.com/index.html?ref=123

How would I store a cookie with name of "ref" and the value of "123"?

+1  A: 

see http://api.rubyonrails.org/classes/ActionController/Cookies.html

use following code in your controller:

cookies[:ref] = 123

or

cookies[:ref] = params[:ref]
zed_0xff
YES! Thank you.
pcasa