Closed otherjohn closed 10 years ago
Hi @otherjohn,
Could you try the following and tell me if it works:
primary.dom_attributes = {
class: 'page-sidebar-menu',
data: {
'auto-scroll' => true,
'slide-speed' => 200
}
}
I just tried it and it works like a charm. The following alternative works perfectly too.
primary.dom_attributes = { :class => 'page-sidebar-menu', 'data-auto-scroll' => 'true', 'data-slide-speed' => '200' }
Which versions of Ruby/Rails/SimpleNavigation do you use?
Actually, both work. I am not sure what I did wrong..
Maybe a tiny typo. Anyway, glad it works fine ;)
Stumbled on the same issue, turns out primary.dom_attributes must go after all items, other way it doesn't work.
I may just be writting this out incorrectly, but I want to do something like:
<ul class="page-sidebar-menu" data-auto-scroll="true" data-slide-speed="200">
But, nothing seems to render correctly. I have tried : primary.dom_attributes = {:class => "page-sidebar-menu", [:'data-auto-scroll'] => "true", [:'data-slide-speed']=>"200"} and primary.dom_attributes = {:class => "page-sidebar-menu", "data-auto-scroll'" => "true", "data-slide-speed" =>"200"}