rails/rails — pull request #3884 by sikachu (2011-12-07 02:13:29+00:00)
Title: Allow layout fallback when using `layout` method

Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail.

For example, consider this snippet:

class CarsController
layout 'single_car', :only => :show
end

Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.

---

Bonus point: I found out that `assert_template :layout => 'blahhhhhh'` will returns true regardless of layout that got rendered. I've fixed that as well.