application_helper.rb 486 B

123456789101112131415161718192021
  1. module ApplicationHelper
  2. def left_nav_bar_items
  3. [
  4. {path: pokemon_index_path, text: "Pokemon"}
  5. ]
  6. end
  7. def right_nav_bar_items
  8. if user_signed_in?
  9. [
  10. {path: edit_registration_path(current_user), text: "Edit"},
  11. {path: destroy_user_session_path(current_user), text: "Sign Out"}
  12. ]
  13. else
  14. [
  15. {path: new_user_session_path, text: "Sign In"},
  16. {path: new_user_registration_path, text: "Sign Up"},
  17. ]
  18. end
  19. end
  20. end