Monday, August 10, 2009

Create Session table in (RoR) Ruby on Rails .!

CREATE TABLE `sessions` (
`id` int(11) NOT NULL auto_increment,
`session_id` varchar(255) default NULL,
`data` varchar(255) default NULL,
`updated_at` datetime default NULL,
`created_at` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


To change Session cookie to Active records do following setting:
cat config/initializers/session_store.rb

* un-comment line
ActionController::Base.session_store = :active_record_store