jejacks0n / navigasmic

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support item block definition

clyfe opened this issue · comments

Because the item is not always text-only, it would be nice to add support for the following syntax:

<% semantic_navigation :app_nav, html: { class: 'nav' } do |n| %>
  <%= n.item link: blah_path do %>
    <i class="icon-th"></i> Blah
  <% end %>
  <%= n.item link: page_path('help') do %>
    <i class="icon-question-sign"></i> Help & Support
  <% end %>
<% end %>

I have a monkeypatch that I used with 0.5.6 here https://gist.github.com/clyfe/4714797

You can actually do this with the configuration (like simple_form).. Can you explain why that method didn't fullfil what you wanted to accomplish?

Indeed configuration solves attributes and decoration but I'd still like to be able to define item content to any markup via block-style syntax, think icons and such.