Generating new application creates a few syntactically bad files in Rails 3.2.1

14 views
Skip to first unread message

nosretep

unread,
Mar 2, 2012, 1:20:55 PM3/2/12
to rubyonra...@googlegroups.com
Running "rails new yourapplicationname" creates all the requisite files, however two of them have bad syntax.

session_store.rb

is:
YourApplicationName::Application.config.session_store :cookie_store, key: '_yourapplicationname_session'

should be:
YourApplicationName::Application.config.session_store :cookie_store, :key => '_yourapplicationname_session'



wrap_parameters.rb

is:
wrap_parameters format: [:json]

should be:
wrap_parameters :format => [:json]


ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]

Walter Lee Davis

unread,
Mar 2, 2012, 1:32:00 PM3/2/12
to rubyonra...@googlegroups.com

What version of Ruby gained the new JSON-style hash notation? Is that a 1.9.3 feature?

Walter

Peter Vandenabeele

unread,
Mar 2, 2012, 3:56:50 PM3/2/12
to rubyonra...@googlegroups.com

Ruby 1.9 has this new hash notation (check Google for "ruby 1.9 new
hash notation").

For `rails new`, you can ask for the "old" hash notation with

[--old-style-hash] # Force using old style hash (:foo =>
'bar') on Ruby >= 1.9

You might run `rails new -h` to see all options (there are other
interesting options there).

HTH,

Peter

nosretep

unread,
Mar 2, 2012, 6:27:57 PM3/2/12
to rubyonra...@googlegroups.com
It appears to be a 1.9.2 addition.
Reply all
Reply to author
Forward
0 new messages