rails/rails — pull request #15050 by apotonick (2014-05-10 01:52:59+00:00)
Title: Simplify Finding Default Layout

# Summary

This PR simlifies the logic for finding default layouts in controllers when rendering.

Note: The code here is still changing, this PR was opened to have a discussion forum and to check general acceptance of this refactoring. All tests pass on my system :grimacing:

# Implementation

While the former implementation was really hard to read and understand, the new `DefaultLayout` class cleanly provides encapsulation, and, more important, removes dozens of line of string evals, `super` calls where it was hard to know what `super` is and removes the need to hook into `inherited`.

Instead, it implements a recursion that travels up the controller inheritance chain to figure out the default layout.