I have a simple-navigation for my View :
SimpleNavigation::Configuration.run do |navigation|
navigation.active_leaf_class = 'active'
navigation.items do |primary|
primary.item :profile,'Profile', edit_user_path do |profile|
profile.item :basic, 'Basic Information', edit_user_path
profile.item :additional, 'Addditional Details', additional_details_user_path
profile.dom_class = 'nav nav-list'
end
primary.item :notifications, 'Notifications', notification_preferences_user_path do |notification|
notification.item :notificatin_preference, 'Notification Preferences', additional_details_user_path
notification.dom_class = 'nav nav-list'
end
primary.dom_class = ‘nav nav-pills’
end
end
Additional details is another method which is not related to edit, so it doesnt highlight the primary profile link when i click on that link. How can I et it right? MY User resources in routes are like this :
resources :users do
member do
get :network
put :peer_tagged_expertise_list
get :qr_code
get :qr_code_image
get :about_you
get :timeline
get :network_tagcloud
get :user_tagcloud
get :settings
get :notification_preferences
get :additional_details
end
collection do
get :test
get :followers
end
resource :networks
end
New Answer after getting more information
The structuring code used in Simple Navigation does not automatically adjust your routes.
In order to get
/users/1/profile/additional_details, your route should include the nesting of user => profile => additional details.The path should be something like
additional_details_user_profile_pathwhen generated. This fixes the URL problem, but I’m not sure if it will fix your highlighting issue with Bootstrap.Old Answer
For simple navigation, use
to set your active nav item class. For Bootstrap, the item should be classed as
active.