Question: I've got a gem (authy's devise gem) where I want to render a different layout than the application layout. It seems like I need to extend their controller DeviseAuthyController, but I'm not sure how to go about doing that How can I accomplish this when the controller is embedded in the gem?

Answer: 
You can just put a `devise.html.erb` under `/app/views/layouts` and all devise views will grab that one.
There's a method called [`devise_controller?`](http://rubydoc.info/github/plataformatec/devise/master/Devise/Controllers/Helpers#devise_controller?-instance_method) which Devise introduces - perhaps it will work for you:

```
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
    layout Proc.new { |controller| controller.devise_controller? ? "your_layout" : "application" }
end

```