class HackathonManager::Engine

Public Instance Methods

after_sign_in_path_for(resource) click to toggle source

Tell Devise where to redirect the user once they sign in

# File lib/hackathon_manager/engine.rb, line 42
def after_sign_in_path_for(resource)
  stored_location = stored_location_for(resource)
  if stored_location
    stored_location
  elsif current_user.admin? || current_user.admin_limited_access?
    manage_root_path
  elsif current_user.questionnaire.nil?
    new_questionnaires_path
  else
    @questionnaire = current_user.questionnaire
    @questionnaire.can_rsvp? ? rsvp_path : questionnaires_path
  end
end