codeplant / simple-navigation

A ruby gem for creating navigations (with multiple levels) for your Rails, Sinatra or Padrino applications. Render your navigation as html list, link list or breadcrumbs.
http://simple-navigation-demo.codeplant.ch/
MIT License
885 stars 136 forks source link

Is there a way to get access to devise current_user somehow? #194

Closed Rubytastic2 closed 8 years ago

Rubytastic2 commented 8 years ago

I need to do some conditional styling but it seems i have no access to current_user from devise from the navigation.rb files. Is there a way to get access to the current_user from within the navigation files?

andi commented 8 years ago

navigation files are evaluated in the view context, i.e. you have access to all helpers that you can use in your views. There is no reason why current_user would not be available in the navigation config files...

Rubytastic2 commented 8 years ago

Got it working my mistake. Thank you andi. Great gem