Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 3551

Show
Ignore:
Timestamp:
02/08/06 05:24:53 (3 years ago)
Author:
marcel
Message:

Replace dubious controller parent class in filter docs. Closes #3655, #3722.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r3550 r3551  
    11*SVN* 
     2 
     3* Replace dubious controller parent class in filter docs. #3655, #3722  [info@rhalff.com, eigentone@gmail.com] 
    24 
    35* Don't interpret the :value option on text_area as an html attribute. Set the text_area's value. #3752 [gabriel@gironda.org] 
  • trunk/actionpack/lib/action_controller/filters.rb

    r3504 r3551  
    142142    #   end 
    143143    # 
    144     #   class SignupController < ActionController::Base 
     144    #   class SignupController < ApplicationController 
    145145    #     # will not run the :authenticate filter 
    146146    #     skip_before_filter :authenticate 
  • trunk/actionpack/lib/action_controller/layout.rb

    r3493 r3551  
    6767    # the layout for your WeblogController. You can create a layout with the name <tt>application.rhtml</tt> or <tt>application.rxml</tt> 
    6868    # and this will be set as the default controller if there is no layout with the same name as the current controller and there is  
    69     # no layout explicitly assigned with the +layout+ method. Setting a layout explicitly will always override the automatic behaviour 
    70     # for the controller where the layout is set. Explicitly setting the layout in a parent class, though, will not override the  
    71     # child class's layout assignement if the child class has a layout with the same name.  
     69    # no layout explicitly assigned with the +layout+ method. Nested controllers use the same folder structure for automatic layout. 
     70    # assignment. So an Admin::WeblogController will look for a template named <tt>app/views/layouts/admin/weblog.rhtml</tt>. 
     71    # Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set. 
     72    # Explicitly setting the layout in a parent class, though, will not override the child class's layout assignement if the child 
     73    # class has a layout with the same name.  
    7274    # 
    7375    # == Inheritance for layouts 
     
    176178          inherited_without_layout(child) 
    177179          child.send :include, Reloadable 
    178           layout_match = child.name.underscore.sub(/_controller$/, '') 
     180          layout_match = child.name.underscore.sub(/_controller$/, '').sub(/^controllers\//, '') 
    179181          child.layout(layout_match) unless layout_list.grep(%r{layouts/#{layout_match}\.[a-z][0-9a-z]*$}).empty? 
    180182        end