Generating new project creates a few files with bad syntax Rails 3.2.1

95 views
Skip to first unread message

Mark Peterson

unread,
Mar 2, 2012, 1:31:25 PM3/2/12
to rubyonra...@googlegroups.com
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]
LX9901145:initializers m2peters$ gem list

Prem Sichanugrist

unread,
Mar 2, 2012, 2:31:18 PM3/2/12
to rubyonra...@googlegroups.com
No, that is Ruby 1.9 hash syntax. It will generate that syntax if you're using Ruby 1.9.

- Prem

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/pJnDpXo8gf4J.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Mark Peterson

unread,
Mar 2, 2012, 3:15:51 PM3/2/12
to rubyonra...@googlegroups.com
You've got to be kidding? Why do these people waste their time with such pointless syntactical changes? Does it improve performance? No. Does it improve readability? No.

Why does the comment in "wrap_parameters.rb" say the following?
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.





On Friday, March 2, 2012 2:31:18 PM UTC-5, Prem Sichanugrist wrote:
No, that is Ruby 1.9 hash syntax. It will generate that syntax if you're using Ruby 1.9.

- Prem
On Mar 2, 2012, at 1:31 PM, Mark Peterson wrote:

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]
LX9901145:initializers m2peters$ gem list


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/pJnDpXo8gf4J.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com.

Michael Koziarski

unread,
Mar 2, 2012, 3:27:12 PM3/2/12
to rubyonra...@googlegroups.com
On Saturday, 3 March 2012 at 9:15 AM, Mark Peterson wrote:
You've got to be kidding? Why do these people waste their time with such pointless syntactical changes? Does it improve performance? No. Does it improve readability? No.

Same reason people waste their time writing such pointless rage filled misinformed emails to mailing lists I guess.    Does it improve understanding? No. Does it improve their perceived intelligence? No.

--
Cheers,

Koz

Prem Sichanugrist

unread,
Mar 2, 2012, 3:28:34 PM3/2/12
to rubyonra...@googlegroups.com
* Don't put a rage on me. I'm not the one who decide this. I explained why it's being that way.
* You can generate you application with old syntax by using --old-style-hash.
* That wrap_parameters thing is something else altogether. It's for when you're calling `@model.to_json`.

- Prem 

To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/Ep4ReP7snLQJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.

Mark Peterson

unread,
Mar 2, 2012, 4:17:57 PM3/2/12
to rubyonra...@googlegroups.com
Not sure where you got the "rage" from.

Mark Peterson

unread,
Mar 2, 2012, 4:18:19 PM3/2/12
to rubyonra...@googlegroups.com
Again, not sure where you got the "rage" from.

Michael Pavling

unread,
Mar 2, 2012, 4:20:50 PM3/2/12
to rubyonra...@googlegroups.com
On 2 March 2012 21:18, Mark Peterson <playe...@gmail.com> wrote:
> Again, not sure where you got the "rage" from.
>

I tend to get it from top-posting with no trimming ;-)

Wael M. Nasreddine

unread,
Mar 2, 2012, 4:21:39 PM3/2/12
to rubyonra...@googlegroups.com
Just taking a long breath to answer you, this syntax change is not pointless, it's a preparation for syntax like this:

some_method(name 'bob', age: 25)

in some_methods, the arguments is not a hash but they are named params..

Anyway, before this becomes a flame war again, post to rubyonrails-talk or ruby ML/IRC

Wael

To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/gZCbJN9eCh4J.

To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Waêl Nasreddine
TechnoGate www.technogate.fr
mobile :  06.41.68.38.35
agence : 09.70.444.236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mark Peterson

unread,
Mar 2, 2012, 4:29:13 PM3/2/12
to rubyonra...@googlegroups.com

So that's what top-posting is. Why does Google Groups default to top-posting!!!!!!!!!!!

:)

Ryan Bigg

unread,
Mar 2, 2012, 4:35:22 PM3/2/12
to rubyonra...@googlegroups.com

On Friday, 2 March 2012 at 12:15 PM, Mark Peterson wrote:

You've got to be kidding? Why do these people waste their time with such pointless syntactical changes

This is what would be gauged as "rage" here. They're not *pointless* syntax changes. They're adapting to the shorter syntax for hashes provided by 1.9. It didn't have to be done, but it's just nicer to have it.

Please don't assume that they're pointless. Most changes in Rails actually do have a point.

Mark Peterson

unread,
Mar 2, 2012, 4:39:57 PM3/2/12
to rubyonra...@googlegroups.com
On Friday, March 2, 2012 4:21:39 PM UTC-5, eMxyzptlk wrote:
Just taking a long breath to answer you, this syntax change is not pointless, it's a preparation for syntax like this:

some_method(name 'bob', age: 25)

in some_methods, the arguments is not a hash but they are named params..

Anyway, before this becomes a flame war again, post to rubyonrails-talk or ruby ML/IRC

Wael



Ah, that makes it all better. Don't they have better things to work on?
(That's a rhetorical question and not directed at you)

Mark Peterson

unread,
Mar 2, 2012, 4:47:09 PM3/2/12
to rubyonra...@googlegroups.com

All these syntactic sugar changes just add to the barriers to entry.
(I don't blame you for this)

Mark Peterson

unread,
Mar 2, 2012, 5:08:05 PM3/2/12
to rubyonra...@googlegroups.com
On Friday, March 2, 2012 4:21:39 PM UTC-5, eMxyzptlk wrote:
Just taking a long breath to answer you, this syntax change is not pointless, it's a preparation for syntax like this:

some_method(name 'bob', age: 25)

in some_methods, the arguments is not a hash but they are named params..

Anyway, before this becomes a flame war again, post to rubyonrails-talk or ruby ML/IRC

Wael

Isn't "name 'bob'" the syntax for passing "bob" as an argument into the "name" method? Or has that all changed too?

If I saw "name 'bob'", I would think that there's a method named "name" defined somewhere.

def name(str)
  # do something with str
end


Trek Glowacki

unread,
Mar 2, 2012, 5:14:16 PM3/2/12
to rubyonra...@googlegroups.com
>
> Isn't "name 'bob'" the syntax for passing "bob" as an argument into the "name" method? Or has that all changed too?
>
> If I saw "name 'bob'", I would think that there's a method named "name" defined somewhere.
>
> def name(str)
> # do something with str
> end
>
>
Sounds like a great question for rubyonrails-talk or ruby ML/IRC.

Prem Sichanugrist

unread,
Mar 2, 2012, 5:14:58 PM3/2/12
to rubyonra...@googlegroups.com
There's a mistyped there in the code. It has to be `name:`, not `name.`

Mark Peterson

unread,
Mar 2, 2012, 5:20:09 PM3/2/12
to rubyonra...@googlegroups.com


Apparently all these syntactical changes confused you too :)

Mark Peterson

unread,
Mar 2, 2012, 5:23:12 PM3/2/12
to rubyonra...@googlegroups.com
On Friday, March 2, 2012 5:14:58 PM UTC-5, Prem Sichanugrist wrote:
There's a mistyped there in the code. It has to be `name:`, not `name.`

I'm scared does "name." mean something? For all I know it does now :)

Prem Sichanugrist

unread,
Mar 2, 2012, 5:25:30 PM3/2/12
to rubyonra...@googlegroups.com
Oh, I put the period in the `` because the sentence ended there. Sorry if that's confused you.

The correct code is this:

some_method(name: 'bob', age: 25)

- Prem

Mark Peterson

unread,
Mar 2, 2012, 5:37:17 PM3/2/12
to rubyonra...@googlegroups.com
Any programmer worth his salt disobeys the imperfection of quotation punctuation rules :)

Putting a period inside the quotes is like having two opening tags but only one closing tag.


Mark Peterson

unread,
Mar 2, 2012, 6:05:05 PM3/2/12
to rubyonra...@googlegroups.com

Should I not tempt Oxford Grammar? Then template that sentiment in your feelings for Java. :)

 

Andrés Mejía

unread,
Mar 2, 2012, 7:06:34 PM3/2/12
to rubyonra...@googlegroups.com
I don't mean to offend, but you are one of the most annoying people to ever write to this list.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/CCxXxD59MokJ.

Wael Nasreddine

unread,
Mar 2, 2012, 7:09:54 PM3/2/12
to rubyonra...@googlegroups.com
lool I second that, he's like nil always whining :)

Sorry dude not offending you, but clearly you woke up on the wrong side of the bed and decided to take it out on the most respectful list, which usually people don't even use to say thanks so we do not bother the brains behind this wonderful code base.

-- 
Wael Nasreddine
Sent from my iPhone

Mark Peterson

unread,
Mar 2, 2012, 7:16:46 PM3/2/12
to rubyonra...@googlegroups.com
On Friday, March 2, 2012 7:06:34 PM UTC-5, Andrés Mejía wrote:
I don't mean to offend, but you are one of the most annoying people to ever write to this list.


I'm certainly not offended. Thanks!

Ryan Bigg

unread,
Mar 2, 2012, 7:19:15 PM3/2/12
to rubyonra...@googlegroups.com

On Friday, 2 March 2012 at 4:06 PM, Andrés Mejía wrote:

I don't mean to offend, but you are one of the most annoying people to ever write to this list.
Fire, meet gasoline.

i.e. This is not the way to deal with people like that. Insults will only generate more insults. Let's not do that, k?

Mark Peterson

unread,
Mar 2, 2012, 7:26:03 PM3/2/12
to rubyonra...@googlegroups.com


On Friday, March 2, 2012 7:09:54 PM UTC-5, eMxyzptlk wrote:
lool I second that, he's like nil always whining :)

Sorry dude not offending you, but clearly you woke up on the wrong side of the bed and decided to take it out on the most respectful list, which usually people don't even use to say thanks so we do not bother the brains behind this wonderful code base.

-- 
Wael Nasreddine
Sent from my iPhone


I guess the defensive postures exhibited in the "why all the rage" comments my instincts set in to pounce :)

Cut out the inferiority complexes. It's unbecoming such a great and powerful framework.

Mark Peterson

unread,
Mar 2, 2012, 7:29:52 PM3/2/12
to rubyonra...@googlegroups.com

I think he's the one who removed include_root_in_json from ActiveResource :)

Chad Woolley

unread,
Mar 2, 2012, 9:25:06 PM3/2/12
to rubyonra...@googlegroups.com
"M" is the mute thread shortcut in gmail:

http://support.google.com/mail/bin/answer.py?hl=en&answer=47787

Don't feed the trolls.

Mark Peterson

unread,
Mar 2, 2012, 11:36:26 PM3/2/12
to rubyonra...@googlegroups.com
Yes, block your ears as users express their concerns.

Johnneylee Rollins

unread,
Mar 2, 2012, 11:47:24 PM3/2/12
to rubyonra...@googlegroups.com
> Yes, block your ears as users express their concerns on the wrong mailing list.

~Johnneylee


>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/rubyonrails-core/-/aDTzgzK3xFsJ.

Mark Peterson

unread,
Mar 3, 2012, 12:02:29 AM3/3/12
to rubyonra...@googlegroups.com
How is "Generating new project creates a few files with bad syntax Rails 3.2.1" on the wrong mailing list?

Don't confuse my reaction to the curious responses of "victims united" as being the purpose of this thread.

I was pointing out something that I thought was a problem.

Is there a mission statement for this mailing list? If there is, I don't see it.


On Friday, March 2, 2012 11:47:24 PM UTC-5, SpaceGhost wrote:
On Fri, Mar 2, 2012 at 11:36 PM, Mark Peterson <playe...@gmail.com> wrote:
> On Friday, March 2, 2012 9:25:06 PM UTC-5, thewoo...@gmail.com wrote:
>>
>> "M" is the mute thread shortcut in gmail:
>>
>> http://support.google.com/mail/bin/answer.py?hl=en&answer=47787
>>
>> Don't feed the trolls.
>
> Yes, block your ears as users express their concerns on the wrong mailing list.

~Johnneylee
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/aDTzgzK3xFsJ.
>

> To post to this group, send email to rubyonrails-core@googlegroups.com.


> To unsubscribe from this group, send email to

> rubyonrails-core+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages