Created
March 28, 2012 17:24
-
-
Save jesscanady/2228411 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/config/navigation.rb | |
+++ b/config/navigation.rb | |
@@ -77,7 +77,7 @@ SimpleNavigation::Configuration.run do |navigation| | |
when 'Administrator' | |
primary.item :users, 'Users', users_path, :highlights_on => :subpath do |users| | |
users.dom_class = 'nav nav-tabs users' | |
- if [email protected]? and [email protected]_record? | |
+ if @user.present? | |
users.item :notes, 'Notes', user_notes_path(@user) | |
users.item :claims, 'Claims', user_claims_path(@user), :if => Proc.new{ @user.user_role.IsConsumer == 1 } | |
users.item :locations, 'Locations', user_addresses_path(@user), :if => Proc.new{ @user.user_role.IsProvider == 1 } | |
@@ -91,7 +91,7 @@ SimpleNavigation::Configuration.run do |navigation| | |
profile.dom_class = 'nav nav-tabs users' | |
profile.item :profile, 'Profile', profile_path | |
# this executes in all contexts, skip when we don't have a @user defined | |
- if [email protected]? | |
+ if @user.present? && [email protected]_record? | |
profile.item :locations, 'Locations', user_addresses_path(@user) | |
profile.item :pictures, 'Pictures', user_pictures_path(@user) | |
profile.item :treatments, 'Treatments', user_treatments_path(@user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment