secret
Created

Which one

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
## 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..

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.