activenavbar 1.0.4 → 2.0.0

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: 968bbb4802835d50cebe03d21032b3ce39624853
4
- data.tar.gz: dc4fb332847a0387132e005f64cb1f0b8c988e26
3
+ metadata.gz: 403d169d3013e86d5dc4b4d0e4aa1b6a938ed955
4
+ data.tar.gz: 43666daca55967dc732d942d7474d3a4318f125f
5
5
  SHA512:
6
- metadata.gz: c68cbef10a321f4c9671060a42eee3a53ea10ee2114bb21826efa0f7080a2413e0358ad718b75ded9a9f09b149697c9f02556b81f283d0f84c7e1f61cd28855f
7
- data.tar.gz: be5e5716a26ff14cb777179237b2330f4fe8213d69f00d316f72b0939dc3d756891ab3b0a5baf5552e82e6ebf5d45ae5a65a6eb72bf9fa59b0a7615461437735
6
+ metadata.gz: 6e298272c6c59d0bacff2a5942cc29965954344224b29b330a418cbbe7e7aa7768ab7535b816b812e41bc30a77812a1554dd0e1c23bf835fa04a026a7656befe
7
+ data.tar.gz: f35447dc7ec7e1e45d4d9eb60ab9a59e917c7183902f7da37c35457804ba02495e3f9e60eaa47a06aba96265753cb3ffc8ffdf7c1a4d27217bb6346a141de390
data/README.md CHANGED
@@ -10,7 +10,7 @@ The simplest way to install is to use Bundler.
10
10
  Add this line to your application's Gemfile:
11
11
 
12
12
  ```ruby
13
- gem 'activenavbar'
13
+ gem 'activenavbar', '~> 1.0.4'
14
14
  ```
15
15
 
16
16
  And then execute:
@@ -31,15 +31,15 @@ Or install it yourself as:
31
31
 
32
32
  ## Usage
33
33
 
34
- Assume we have home, post and category page, and have navbar for each page below:
34
+ Assume we have home, food and beverage page, and have navbar for each page below:
35
35
 
36
36
  %ul
37
37
  %li
38
38
  = link_to "Home", homes_path
39
39
  %li
40
- = link_to "Food", posts_path
40
+ = link_to "Food", foods_path
41
41
  %li
42
- = link_to "Beverage", categories_path
42
+ = link_to "Beverage", beverages_path
43
43
 
44
44
  Assume we have style sheet for navbar below:
45
45
 
@@ -67,8 +67,8 @@ Now we want a navbar link becomes active when we click on it:
67
67
 
68
68
  %ul
69
69
  = navbar_link "Home", root_path, "active"
70
- = navbar_link "Food", posts_path, "active"
71
- = navbar_link "Beverage", categories_path, "active"
70
+ = navbar_link '<span class="glyphicon glyphicon-heart"></span> Food', foods_path, "active"
71
+ = navbar_link "Beverage", beverages_path, "active"
72
72
 
73
73
  Well, Home link becomes active when we click on Home link.
74
74
 
@@ -76,8 +76,8 @@ HTML output:
76
76
 
77
77
  <ul>
78
78
  <li class="active"><a href="/">Home</a></li>
79
- <li class=""><a href="/posts">Post</a></li>
80
- <li class=""><a href="/categories">Category</a></li>
79
+ <li class=""><a href="/foods"><span class="glyphicon glyphicon-heart"></span>Food</a></li>
80
+ <li class=""><a href="/beverages">Beverage</a></li>
81
81
  </ul>
82
82
 
83
- Say hi to me @bunlongvan
83
+ Say hi to me @bunlongvan
Binary file
Binary file
Binary file
Binary file
@@ -3,7 +3,11 @@ require "activenavbar/version"
3
3
  module Activenavbar
4
4
  def navbar_link(label, path, active_class)
5
5
  class_name = current_page?(path) || path == "/#{request.fullpath.split('/')[1]}" ? active_class : ''
6
- content_tag(:li, :class => class_name) { link_to label, path }
6
+ content_tag(:li, :class => class_name) do
7
+ link_to path do
8
+ label.html_safe
9
+ end
10
+ end
7
11
  end
8
12
  end
9
13
 
@@ -1,3 +1,3 @@
1
1
  module Activenavbar
2
- VERSION = "1.0.4"
2
+ VERSION = "2.0.0"
3
3
  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
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bunlong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-15 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,6 +55,10 @@ files:
55
55
  - activenavbar-0.0.1.gem
56
56
  - activenavbar-0.0.2.gem
57
57
  - activenavbar-1.0.0.gem
58
+ - activenavbar-1.0.1.gem
59
+ - activenavbar-1.0.2.gem
60
+ - activenavbar-1.0.3.gem
61
+ - activenavbar-1.0.4.gem
58
62
  - activenavbar.gemspec
59
63
  - gem-private_key.pem
60
64
  - lib/activenavbar.rb