From 20a9bddfada88a8a46effc2e9c93190c58ba9318 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Jun 2011 10:31:16 -0400 Subject: reorder layout selection examples to occur in the order that the code does, and provide more detail on why each selection is made --- actionpack/lib/abstract_controller/layouts.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/abstract_controller/layouts.rb') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 8f73e244d7..5765ad34f7 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -81,11 +81,12 @@ module AbstractController # class EmployeeController < BankController # layout nil # - # The InformationController uses "bank_standard" inherited from the BankController, the VaultController overwrites - # and picks the layout dynamically, and the EmployeeController doesn't want to use a layout at all. - # - # The TellerController uses +teller.html.erb+, and TillController inherits that layout and - # uses it as well. + # In these examples: + # * The InformationController will use the "bank_standard" layout, which is inherited from BankController + # * The TellerController will follow convention and use +app/views/layouts/teller.html.erb+ + # * The TillController will inherit the layout from TellerController and use +teller.html.erb+ as well + # * The VaultController will pick a layout dynamically by calling the access_level_layout method + # * The EmployeeController will not use a layout # # == Types of layouts # -- cgit v1.2.3 From 538d2a52ce5025861f554c8e5ef850d0098a914d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Jun 2011 10:34:31 -0400 Subject: remove extra space and clarify how an exception is made for controller wide layouts --- actionpack/lib/abstract_controller/layouts.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/abstract_controller/layouts.rb') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 5765ad34f7..5853fb7852 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -139,8 +139,8 @@ module AbstractController # # end # - # This will assign "weblog_standard" as the WeblogController's layout except for the +rss+ action, which will not wrap a layout - # around the rendered view. + # This will assign "weblog_standard" as the WeblogController's layout for all actions except for the +rss+ action, which will + # be rendered directly, without wrapping a layout around the rendered view. # # Both the :only and :except condition can accept an arbitrary number of method references, so # #:except => [ :rss, :text_only ] is valid, as is :except => :rss. @@ -159,7 +159,7 @@ module AbstractController # end # end # - # This will render the help action with the "help" layout instead of the controller-wide "weblog_standard" layout. + # This will override the controller-wide "weblog_standard" layout, and will render the help action with the "help" layout instead. module Layouts extend ActiveSupport::Concern -- cgit v1.2.3 From db4f0ac025a53017b35337f81e1096a58fdce1fb Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 21 Jun 2011 15:12:11 -0400 Subject: use present tense on examples --- actionpack/lib/abstract_controller/layouts.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/abstract_controller/layouts.rb') diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 5853fb7852..d6f75bded0 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -82,11 +82,11 @@ module AbstractController # layout nil # # In these examples: - # * The InformationController will use the "bank_standard" layout, which is inherited from BankController - # * The TellerController will follow convention and use +app/views/layouts/teller.html.erb+ - # * The TillController will inherit the layout from TellerController and use +teller.html.erb+ as well - # * The VaultController will pick a layout dynamically by calling the access_level_layout method - # * The EmployeeController will not use a layout + # * The InformationController uses the "bank_standard" layout, inherited from BankController. + # * The TellerController follows convention and uses +app/views/layouts/teller.html.erb+. + # * The TillController inherits the layout from TellerController and uses +teller.html.erb+ as well. + # * The VaultController chooses a layout dynamically by calling the access_level_layout method. + # * The EmployeeController does not use a layout at all. # # == Types of layouts # -- cgit v1.2.3