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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4b4b1e577faf5b816cb7dba047e718b5181ee1b
4
- data.tar.gz: 52c0e1219b172d00669e3cbe9125c7e84aa0f630
3
+ metadata.gz: 5f5681f9038cd841546459b4c708170a8089095c
4
+ data.tar.gz: 0ddd69d307f6b783a64ce397633f17fcf92a5db3
5
5
  SHA512:
6
- metadata.gz: 8bb585ec127613c384a1557a772555101e662cff0f97142c7a9dbce4c71e0a682f7aaa038b39b56273eda9b939ee6c9675b20a4c20e46f711f6645f86ca3e688
7
- data.tar.gz: 0aaadac717ddc386f891bae11b2b31ff5bcced6e27bca9859a5fc9db39304541f104b8ed8fa8d73361cf3f67e29057ef810ce809fdaf539ee584e31a48efa858
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", homes_path, "active"
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="/homes">Home</a></li>
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
@@ -1,3 +1,3 @@
1
1
  module Activenavbar
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.3"
3
3
  end
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.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-08-20 00:00:00.000000000 Z
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