国产一区二区精品久久_蜜桃狠狠狠狠狠狠狠狠狠_午夜视频精品_激情都市一区二区

當前位置:首頁 > 網站舊欄目 > 學習園地 > 設計軟件教程 > 每天一劑Rails良藥之Convert Your Sessions To ActiveRecord

每天一劑Rails良藥之Convert Your Sessions To ActiveRecord
2010-01-14 07:07:13  作者:  來源:
我們看看config/environment.rb文件,其中有以下一段:
Java代碼 復制代碼
  1. # Use the database for sessions instead of the file system   
  2. # (create the session table with 'rake db:sessions:create')   
  3. # config.action_controller.session_store = :active_record_store  

Rails默認使用文件系統存儲sessions信息,但是更快和更利于維護的方式是用ActiveRecord和數據庫來存儲,所以我們運行rake db:sessions:createrake db:migrate來創建sessions表并將config.action_controller.session_store = :active_record_store取消comment即可

安徽新華電腦學校專業職業規劃師為你提供更多幫助【在線咨詢