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

Changeset 3462

Show
Ignore:
Timestamp:
01/22/06 07:41:27 (3 years ago)
Author:
marcel
Message:

Change layout discovery to take into account the change in semantics with File.join and nil arguments.

Files:

Legend:

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

    r3459 r3462  
    11*SVN* 
     2 
     3* Change layout discovery to take into account the change in semantics with File.join and nil arguments. [Marcel Molina Jr.] 
    24 
    35* Raise a RedirectBackError if redirect_to :back is called when there's no HTTP_REFERER defined #3049 [kevin.clark@gmail.com] 
  • trunk/actionpack/lib/action_controller/layout.rb

    r3441 r3462  
    208208      # but auto-discovered layouts derived from a nested controller will contain a slash, though be relative 
    209209      # to the 'layouts' directory so we have to check the file system to infer which case the layout name came from. 
    210       nested_controller = File.directory?(File.dirname(File.join(self.class.template_root, 'layouts', active_layout))) 
     210      nested_controller = File.directory?(File.dirname(File.join(self.class.template_root, 'layouts', active_layout))) if active_layout 
    211211      active_layout.include?('/') && !nested_controller ? active_layout : "layouts/#{active_layout}" if active_layout 
    212212    end