Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from XML to JSON in scaffold generator, and use Ruby 1.9 hash style #256

Closed
wants to merge 4 commits into from

Conversation

sikachu
Copy link
Member

@sikachu sikachu commented Apr 10, 2011

Hi guys,

As per @dhh's request, I've finished the following patches:

Switch from XML to JSON in scaffold generator

This is really straightforward. Note that in update and destroy we have to return empty hash so that jQuery will understand that the response is correct. That has been patched in https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/responder.rb#L262-278 as well.

Use Ruby 1.9 hash style

I've updated scaffold generator and app generator to use Ruby 1.9 hash. I've accomplished it by adding key_value method which will detect Ruby version and returns the right key-value hash according to the version.

I also take it further by adding --old-style-hash in case someone might want to make their code compatible with 1.8.x, or just sanely hate 1.9 style hash.

Please review the patch and see if they're appropriate. Thank you.

…stead of XML

It seems like a lot of people are using JSON in their API more than XML nowadays, so Rails should follow that convention by providing the JSON format block in scaffold_controller by default.

This patch has been requested by DHH
…troller generator on Ruby 1.9.x

The new hash syntax of Ruby 1.9 looks more superior, so we decide to switch to it in the places that appropriate.

This patch has been requested by DHH.
…r on Ruby 1.9.x

The new hash syntax of Ruby 1.9 looks more superior, so we decide to switch to it in the places that appropriate.
That means if you don't like the new syntax, you can pass --old-style-hash to force Rails to generate code with hash rockets.
@josevalim
Copy link
Contributor

DHH merged already. :)

@josevalim josevalim closed this Apr 10, 2011
@sikachu
Copy link
Member Author

sikachu commented Apr 10, 2011

This has been merged \o/

matthewd pushed a commit that referenced this pull request Apr 24, 2018
matthewd pushed a commit that referenced this pull request Apr 24, 2018
test gem build in ci process, inspired by issue #256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants