开发者

rails 3.1 key value problem

开发者 https://www.devze.com 2023-04-03 23:23 出处:网络
rails 3.1 with ruby 1.9.2p290 on windows generates initialers/config/session_store.rb Hello::Application.config.session_store :cookie_store, key: \'_hello_session\'

rails 3.1 with ruby 1.9.2p290 on windows generates

initialers/config/session_store.rb

Hello::Application.config.session_store :cookie_store, key: '_hello_session'

key: 'hello_session'开发者_运维百科 is :key => 'hello_session' in some of my old apps. What makes rails to generate different codes? Ruby version or rails version ?


There's a new hash syntax in ruby 1.9, you can write:

{key: "hello_session"}

instead of:

{:key => "hello_session"}

The 1.8 syntax is still supported, use it if you want your app to be compatible with both 1.8 and 1.9.


I resolved this by removing my ~/.rvm directory and reinstalling RVM.

0

精彩评论

暂无评论...
验证码 换一张
取 消