diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-01-19 23:12:05 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-01-19 23:13:19 +0530 |
commit | 6e311b93adf295b97a1ad6056675d32ff51b212f (patch) | |
tree | e8557448cea8be6354cff5eeefb5972d86b65545 /railties/guides/code/getting_started/config | |
parent | 4c5b73fef8a41bd2bd8435fa4b00f7c40b721650 (diff) | |
download | rails-6e311b93adf295b97a1ad6056675d32ff51b212f.tar.gz rails-6e311b93adf295b97a1ad6056675d32ff51b212f.tar.bz2 rails-6e311b93adf295b97a1ad6056675d32ff51b212f.zip |
update the getting_started guide code [ci skip]
Diffstat (limited to 'railties/guides/code/getting_started/config')
4 files changed, 19 insertions, 8 deletions
diff --git a/railties/guides/code/getting_started/config/application.rb b/railties/guides/code/getting_started/config/application.rb index e16da30f72..9026a5b5e1 100644 --- a/railties/guides/code/getting_started/config/application.rb +++ b/railties/guides/code/getting_started/config/application.rb @@ -4,7 +4,7 @@ require 'rails/all' if defined?(Bundler) # If you precompile assets before deploying to production, use this line - Bundler.require *Rails.groups(:assets => %w(development test)) + Bundler.require(*Rails.groups(:assets => %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.require(:default, :assets, Rails.env) end @@ -44,6 +44,12 @@ module Blog # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + # config.active_record.whitelist_attributes = true + # Enable the asset pipeline config.assets.enabled = true diff --git a/railties/guides/code/getting_started/config/environments/test.rb b/railties/guides/code/getting_started/config/environments/test.rb index 08697cbbc9..8b826f56ef 100644 --- a/railties/guides/code/getting_started/config/environments/test.rb +++ b/railties/guides/code/getting_started/config/environments/test.rb @@ -29,9 +29,9 @@ Blog::Application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test + # Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + # Print deprecation notices to the stderr config.active_support.deprecation = :stderr - - # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets - config.assets.allow_debugging = true end diff --git a/railties/guides/code/getting_started/config/initializers/inflections.rb b/railties/guides/code/getting_started/config/initializers/inflections.rb index 9e8b0131f8..5d8d9be237 100644 --- a/railties/guides/code/getting_started/config/initializers/inflections.rb +++ b/railties/guides/code/getting_started/config/initializers/inflections.rb @@ -8,3 +8,8 @@ # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end +# +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/railties/guides/code/getting_started/config/routes.rb b/railties/guides/code/getting_started/config/routes.rb index 31f0d210db..b048ac68f1 100644 --- a/railties/guides/code/getting_started/config/routes.rb +++ b/railties/guides/code/getting_started/config/routes.rb @@ -1,7 +1,7 @@ Blog::Application.routes.draw do - resources :posts do - resources :comments - end + resources :posts do + resources :comments + end get "home/index" @@ -60,5 +60,5 @@ Blog::Application.routes.draw do # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id(.:format)))' + # match ':controller(/:action(/:id))(.:format)' end |