bootstrap_toolbelt 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13c1634a12491b3279f995258a312ac0259a1e94
4
- data.tar.gz: d065d62a06a47652338ef28ae1772be4e214bc82
3
+ metadata.gz: 60e7abb65c07e3bd5f8c57006456e2a088a77192
4
+ data.tar.gz: adfbf1590ce69f6fbacdd29fd4e337589cc01d9e
5
5
  SHA512:
6
- metadata.gz: a30a56a885a65b23d401114f37c765af572b5b14ef02eb7b33720c6936138e206b927b475e05f679a77c8bb60075989fbcc6883186dcd6cdcf58c00dfeca45c6
7
- data.tar.gz: 5f3b943cbcbf65562de1654e866425aaf50a6ce1b6e56299a523edd6d47df4474e8bfd63c822b3ae2b54854a517df3b4a3d493e3b0f5d8ba517e7817f3a28c0b
6
+ metadata.gz: 3503a3ce03757c259139d19849f3799fad34ebdecfdac81a556969890dd6ecc61889179355290f43f0b0305175fd6ea4b92174876259db10a31fa1f40f9dc343
7
+ data.tar.gz: ff332761fc4b8abfe471ab19c9f9622d343ec49a3b92fe1455c1a66db09282a15b3fef4cbe18a2539667e0d86ab819595974e0b3aad67b1b00bdedd3cfff3c23
@@ -1,9 +1,18 @@
1
1
  module NavigationHelper
2
2
  def nav_link(text, link_path, options = {}, &block)
3
- active_class_name = current_page?(link_path) ? options.fetch(:active_class_name, 'active') : ''
3
+ link_options = options.fetch(:link_options, {})
4
+ link_options[:class] = link_classes(link_path, link_options)
5
+ list_options = options.fetch(:list_options, {})
6
+
4
7
  inner = capture(&block)
5
- content_tag(:li, class: options.fetch(:class_name, '')) do
6
- concat(link_to(text, link_path, class: active_class_name)).concat( block_given? ? inner : "" )
8
+ content_tag(:li, list_options) do
9
+ concat(link_to(text, link_path, link_options)).concat( block_given? ? inner : "" )
7
10
  end
8
11
  end
12
+
13
+ private
14
+
15
+ def link_classes(link_path, options)
16
+ current_page?(link_path) ? options.fetch(:class, "active") : ""
17
+ end
9
18
  end
@@ -1,3 +1,3 @@
1
1
  module BootstrapToolbelt
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_toolbelt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristian Rasmussen