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
Advertisements

Tagged: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading how to make layout false for devise controller at Kubid on rails blog.

meta

%d bloggers like this: