Skip to content

Commit

Permalink
Change layout discovery to take into account the change in semantics …
Browse files Browse the repository at this point in the history
…with File.join and nil arguments.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3462 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
Marcel Molina committed Jan 22, 2006
1 parent cffd1a9 commit 8d4d88a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*SVN*

* Change layout discovery to take into account the change in semantics with File.join and nil arguments. [Marcel Molina Jr.]

* Raise a RedirectBackError if redirect_to :back is called when there's no HTTP_REFERER defined #3049 [kevin.clark@gmail.com]

* Treat timestamps like datetimes for scaffolding purposes #3388 [Maik Schmidt]
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def active_layout(passed_layout = nil)
# Explicitly passed layout names with slashes are looked up relative to the template root,
# but auto-discovered layouts derived from a nested controller will contain a slash, though be relative
# to the 'layouts' directory so we have to check the file system to infer which case the layout name came from.
nested_controller = File.directory?(File.dirname(File.join(self.class.template_root, 'layouts', active_layout)))
nested_controller = File.directory?(File.dirname(File.join(self.class.template_root, 'layouts', active_layout))) if active_layout
active_layout.include?('/') && !nested_controller ? active_layout : "layouts/#{active_layout}" if active_layout
end

Expand Down

0 comments on commit 8d4d88a

Please sign in to comment.