Skip to content

Instantly share code, notes, and snippets.

@beneggett
Created May 30, 2012 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beneggett/7e791ea31fc4b9ba4065 to your computer and use it in GitHub Desktop.
Save beneggett/7e791ea31fc4b9ba4065 to your computer and use it in GitHub Desktop.
Which one
## This is how it is in the codebase (with my devise paths defined)
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
end
def spree_current_user
current_user
end
def spree_login_path
main_app.new_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
## This is how it is in the documentation (with my devise paths defined)
module Spree
module Core
module ControllerHelpers
def spree_current_user
current_user
end
def spree_login_path
main_app.new_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
end
# Which is correct? I'm not getting either to work..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment