Skip to content

Instantly share code, notes, and snippets.

@kulbirsaini
Created March 10, 2011 05:51
Show Gist options
  • Save kulbirsaini/863635 to your computer and use it in GitHub Desktop.
Save kulbirsaini/863635 to your computer and use it in GitHub Desktop.
Using devise sign in, sign up views through your rails app
# 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