jejacks0n / navigasmic

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

Configurable options, allow custom highlighted class #14

Closed pengwynn closed 12 years ago

pengwynn commented 12 years ago

I wanted to use Navigasmic in a Twitter Bootstrap project which defaults to an active class for highlighted items. This patch adds a configuration helper to override tag names and class names that were hardcoded in the builder:

Navigasmic.setup do |config|
  config.highlighted_class = 'active'
end
jejacks0n commented 12 years ago

Thank you. :)

enceem commented 12 years ago

Where should configuration be done?

Navigasmic.setup do |config|
  config.highlighted_class = 'active'
end
jejacks0n commented 12 years ago

I'm adding additional information to this with the update (since it shows in the google results for navigasmic)

The configuration has changed and has a bootstrap named configuration

To use this configuration you can either remove the named part (the bootstrap: name) to make it default, or you can pass it to the helper:

<%= semantic_navigation :primary, config: :bootstrap %>