Created
June 8, 2012 22:28
-
-
Save rohitnair/2898445 to your computer and use it in GitHub Desktop.
authentication_helpers.rb for Spree
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
module Spree | |
module AuthenticationHelpers | |
def self.included(receiver) | |
receiver.send :helper_method, :spree_login_path | |
receiver.send :helper_method, :spree_signup_path | |
receiver.send :helper_method, :spree_logout_path | |
receiver.send :helper_method, :spree_current_user | |
end | |
def spree_current_user | |
current_user | |
end | |
def spree_login_path | |
main_app.new_user_session_path | |
end | |
def spree_signup_path | |
main_app.new_user_registration_path | |
end | |
def spree_logout_path | |
main_app.destroy_user_session_path | |
end | |
end | |
end | |
ApplicationController.send :include, Spree::AuthenticationHelpers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment