activenavbar 1.0.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/activenavbar-0.0.2.gem +0 -0
- data/activenavbar-1.0.0.gem +0 -0
- data/lib/activenavbar/version.rb +1 -1
- data/lib/activenavbar.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f5681f9038cd841546459b4c708170a8089095c
|
4
|
+
data.tar.gz: 0ddd69d307f6b783a64ce397633f17fcf92a5db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95fe585cb24795d6b20ac15d40412ea13d1fe9c7a0d6348685e59569a91a95f702192e56e32a110e441463868975c7f857fcbb5a2121cbc9eca6e648ae5db1d6
|
7
|
+
data.tar.gz: c41ca1a758459fbd7f8337e35d6a53a2c056635c65e62533ee9cfacf341a57ca75f9b61db3f30227162860f70699fb8fa94a201d08f1767b9983afe59a4f433d
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Activenavbar
|
1
|
+
# Activenavbar [![Gem Version](https://badge.fury.io/rb/activenavbar.svg)](http://badge.fury.io/rb/activenavbar)
|
2
2
|
|
3
3
|
active navbar is used to set the active navbar link, a navbar link becomes active when you click on it.
|
4
4
|
|
@@ -66,7 +66,7 @@ Assume we have style sheet for navbar below:
|
|
66
66
|
Now we want a navbar link becomes active when we click on it:
|
67
67
|
|
68
68
|
%ul
|
69
|
-
= navbar_link "Home",
|
69
|
+
= navbar_link "Home", root_path, "active"
|
70
70
|
= navbar_link "Food", posts_path, "active"
|
71
71
|
= navbar_link "Beverage", categories_path, "active"
|
72
72
|
|
@@ -75,7 +75,7 @@ Well, Home link becomes active when we click on Home link.
|
|
75
75
|
HTML output:
|
76
76
|
|
77
77
|
<ul>
|
78
|
-
<li class="active"><a href="/
|
78
|
+
<li class="active"><a href="/">Home</a></li>
|
79
79
|
<li class=""><a href="/posts">Post</a></li>
|
80
80
|
<li class=""><a href="/categories">Category</a></li>
|
81
81
|
</ul>
|
Binary file
|
Binary file
|
data/lib/activenavbar/version.rb
CHANGED
data/lib/activenavbar.rb
CHANGED
@@ -2,7 +2,7 @@ require "activenavbar/version"
|
|
2
2
|
|
3
3
|
module Activenavbar
|
4
4
|
def navbar_link(label, path, active_class)
|
5
|
-
class_name = current_page?(path) ? active_class : ''
|
5
|
+
class_name = current_page?(path) || current_page?("/#{request.fullpath.split('/')[1]}") ? active_class : ''
|
6
6
|
content_tag(:li, :class => class_name) { link_to label, path }
|
7
7
|
end
|
8
8
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activenavbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bunlong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,6 +53,8 @@ files:
|
|
53
53
|
- README.md
|
54
54
|
- Rakefile
|
55
55
|
- activenavbar-0.0.1.gem
|
56
|
+
- activenavbar-0.0.2.gem
|
57
|
+
- activenavbar-1.0.0.gem
|
56
58
|
- activenavbar.gemspec
|
57
59
|
- gem-private_key.pem
|
58
60
|
- lib/activenavbar.rb
|