Created
March 10, 2011 05:51
-
-
Save kulbirsaini/863635 to your computer and use it in GitHub Desktop.
Using devise sign in, sign up views through your rails app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File : app/helpers/auth_helper.rb | |
# include this module in app/controllers/application_controller.rb | |
# include AuthHelper | |
# Module to define some functions to use devise views in any | |
# of your controllers to render sign_in or sign_up pages. | |
module AuthHelper | |
# Included for devise_error_messages! | |
include DeviseHelper | |
def resource_name | |
:user | |
end | |
def resource | |
@resource ||= User.new | |
end | |
def devise_mapping | |
@devise_mapping ||= Devise.mappings[:user] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment