jejacks0n / navigasmic

Navigasmic: Semantic navigation for Rails using simple view level or configuration definitions.
322 stars 29 forks source link

Error in Ruby example in the README #23

Closed yemartin closed 11 years ago

yemartin commented 11 years ago

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?

jejacks0n commented 11 years ago

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.