jejacks0n / navigasmic

Navigasmic: Semantic navigation for Rails using simple view level or configuration definitions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Ruby example in the README

yemartin opened this issue · comments

I think there is an error in the README, under Usage / Defining Navigation in Initializer:

config.semantic_navigation :primary do |n|
  n.group 'Blog', class: 'blog' do
    '<li>Custom Node</li>'.html_safe # <----------- THIS LINE
    n.item 'Articles', controller: '/blog/posts'
    n.item 'Links', controller: '/blog/links'
  end
end

How is the line marked above supposed to work? It looks to me that it just creates a string that gets discarded right away. It tried the code and indeed, "Custom Node" did not appear in the output. (It did work the the HAML version below it)

Did I miss something or is it a bug in the README? If it is a bug, how would one achieve the same effect?

It was supposed to work at one point, but I think I dropped the "feature" because it made things overly complicated.. thanks for the heads up.