Permalink
Browse files

This example is better for guides and gem/plugins docs

  • Loading branch information...
1 parent d4151d7 commit 6ce761c8d98dafca0baeb298c10dd1fef5e4224f @spastorino spastorino committed with jeremy Jul 20, 2010
Showing with 0 additions and 7 deletions.
  1. +0 −7 railties/lib/rails/generators/rails/app/templates/config/application.rb
@@ -46,13 +46,6 @@ class Application < Rails::Application
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
<% end -%>
- # Configure generators values. Many other options are available, be sure to check the documentation.
- # config.generators do |g|
- # g.orm :active_record
- # g.template_engine :erb
- # g.test_framework :test_unit, :fixture => true
- # end
-
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"

11 comments on commit 6ce761c

Which example is better?

Owner

spastorino replied Aug 4, 2010

Sorry for my english i mean the commented code here is an example and it's better to go to a guide or on the documentation of the gems or plugins that are trying to modify the default behavior

Contributor

fredwu replied Aug 5, 2010

This is such a useful configuration (which I use in every rails 3 project), can we please put it back in? So instead of copy/pasting it from the guides, we can just uncomment it and use it straight away.

Member

lukaszx0 replied Aug 5, 2010

Yep, I agree with fredwu. I think this should be as a comment. It's very handy.

Agreed, this should be in. Swapping out components should be as obvious and easy as possible.

Contributor

dmathieu replied Aug 5, 2010

Agreed too. Moreover, it can be in guides AND as a comment. Having too much doc is way better than not having enough.

Contributor

davout replied Aug 5, 2010

i agree too

@spastorino Where can this information be found in the current docs? Rails::Configuration::Generators is #nodoc'd and I can't find anything in the Rails Guides about it. I'd be fine with comment-cruft being removed if it were well documented. In this case though…

+1 to putting this comment block back in, it's a helpful signal to us noobs on what defaults can be overridden. (Details on "how" they are overridden belongs in separate docs/guides.)

Owner

spastorino replied Aug 14, 2010

Guys gems/plugins do this things for youm check for instance rspec 2.0.0.beta.19. You shouldn't change this by hand. Please refer to gems/plugins documentation and feel free to add/change the guidelines they are in http://github.com/lifo/docrails and you are free to change it ;). Sorry for the delay in the answer i was out.

@spastorino, config.generators is also about configuring plugins, not just enabling them. My Rspec block for example:

g.test_framework :rspec,
:controller_specs => false,
:view_specs => false

And not just plugins but also core rails. A fresh rails project has several options: stylesheets, helper, fixture, migration, timestamps.

I expect to use config.generators in every single rails project I create. It would be nice to have it there waiting for me to just uncomment and use. And for new developers to have a ready example.

Please sign in to comment.