We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
When generating the configuration in a rails 4 app with simple-navigation 4.0.3, the generated config does not seem to work.
For example I have this line:
primary.item :key_3, 'Admin', url, class: 'special', if: -> { current_user.admin? }
In this case the class does not get applied (using all the time the default renderer, List).
The only way for me to get it to work was to write it in the form (I am not interested in the "if"):
primary.item :key_3, 'Admin', url, html: { class: 'special' }
I could not find anything about this "html" parameter in the documentation.
Also if I try to use the html parameter in an item which will be passed a submenu, well I can't figure out how to make it work. The following snippet:
primary.item :about, 'About', html: { class: 'nav-link' } do |sub_nav| sub_nav.item :who_are_we, 'Who are we?', page_path('who_are_we'), html: { class: 'nav-link' } end
gives me the error:
undefined method `split' for {:html=>{:class=>"nav-link"}}:Hash
Thanks for your help.
The text was updated successfully, but these errors were encountered:
For the second problem I had, I have found that it was because I was missing an argument to the item. Using
primary.item :about, 'About', '', html: { class: 'nav-link' } do |sub_nav| sub_nav.item :who_are_we, 'Who are we?', page_path('who_are_we'), html: { class: 'nav-link' } end
works alright.
Still unsure that the rails generator is really up to date, and I think the html argument may be better documented.
Sorry, something went wrong.
No branches or pull requests
Hi,
When generating the configuration in a rails 4 app with simple-navigation 4.0.3, the generated config does not seem to work.
For example I have this line:
In this case the class does not get applied (using all the time the default renderer, List).
The only way for me to get it to work was to write it in the form (I am not interested in the "if"):
I could not find anything about this "html" parameter in the documentation.
Also if I try to use the html parameter in an item which will be passed a submenu, well I can't figure out how to make it work.
The following snippet:
gives me the error:
Thanks for your help.
The text was updated successfully, but these errors were encountered: