how to make layout false for devise controller

July 5, 2011 § Leave a comment

since I wanna use the login page as a popup box use facebox.. not to redirected the user. the whole layout is appear to the facebox.. so how to make the layout false if we use devise?

simple.. check the current controller is a Devise::SessionsController or not in ApplicationController :

class ApplicationController < ActionController::Base
  layout :layout

  private

  def layout
    is_a?(Devise::SessionsController) ? false : "application"
  end

end

Where Am I?

You are currently viewing the archives for July, 2011 at Kubid on rails blog.