Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2.  
  3. def is_coach?
  4. user_signed_in? ? current_user.is_coach : 'false'
  5. end
  6.  
  7. protected
  8.  
  9. end
  10.  
  11. undefined method `is_coach?'
  12.  
  13. #config/navigation.rb
  14. SimpleNavigation::Configuration.run do |navigation|
  15. navigation.selected_class = 'current'
  16. navigation.items do |primary|
  17. primary.item :home, 'Home', '/'
  18. primary.item :home, 'Clients', '/clients', class: 'special', if: -> { is_coach? }
  19. end
  20. end
  21.  
  22. <%= render_navigation %>
  23.  
  24. def is_coach?
  25. user_signed_in? ? current_user.is_coach : 'false'
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement