セッションストアにActiveRecordを使用するには、environment.rbで以下の箇所のコメントを外す。
config.action_controller.session_store = :active_record_storeセッション格納用のテーブルは、
rake db:sessions:create rake db:migrateで作成。
セッションストアにActiveRecordを使用するようにしたら、以下のエラーが発生。
No :secret given to the #protect_from_forgery call. Set that or use a session store capable of generating its own keys (Cookie Session Store).
application.rbで以下の箇所の:secretのコメントを外したら解決。
# See ActionController::RequestForgeryProtection for details # Uncomment the :secret if you're not using the cookie session store protect_from_forgery # :secret => '7136b0968f24e7318da7eb62e50d05b7'


コメントする