navigation_link_to 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4f3536374e283c6560b0c8c7d73f32b3e9769a3f
4
+ data.tar.gz: 6c10cf5ad50120145911fa6f4971bf1411f291d4
5
+ SHA512:
6
+ metadata.gz: 047a3fc662130d1a3b924fe0674efe3815dd4eae193073029bf61a18b37e40a4bd680ffdde41b4f6e0eb27463f410e57542046aaeecf6aee3bfe702f9aa800fc
7
+ data.tar.gz: de18f13bc0ce892cba2f028564c022f46be7f7647f9735fe0d345f9a77dc01f8a73afe3fd3b87f673a7762636a1e203eeae606dc97707edafa1b83982e0475cf
@@ -23,7 +23,10 @@ module NavigationLinkTo
23
23
  url = url_for(options)
24
24
  controller = html_options[:controller]
25
25
  wrapper = html_options[:wrapper].nil? ? 'li' : html_options[:wrapper]
26
- if (controller && controller?(controller)) || current_page?(url) || html_options[:active]
26
+ is_current_controller = controller && controller?(controller)
27
+ is_current_page = current_page?(url) && !html_options.has_key?(:active)
28
+ is_force_active = html_options[:active]
29
+ if is_current_controller || is_current_page || is_force_active
27
30
  html_options[:class] = [html_options[:class], 'active'].compact.join(' ')
28
31
  html_options[:wrapper_class] = [html_options[:wrapper_class], 'active'].compact.join(' ')
29
32
  end
@@ -1,3 +1,3 @@
1
1
  module NavigationLinkTo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: navigation_link_to
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Droid Labs
@@ -10,7 +9,7 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-11-04 00:00:00.000000000 Z
12
+ date: 2013-12-02 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: navigation_link_to view helper
16
15
  email:
@@ -29,26 +28,25 @@ files:
29
28
  - navigation_link_to.gemspec
30
29
  homepage: ''
31
30
  licenses: []
31
+ metadata: {}
32
32
  post_install_message:
33
33
  rdoc_options: []
34
34
  require_paths:
35
35
  - lib
36
36
  required_ruby_version: !ruby/object:Gem::Requirement
37
- none: false
38
37
  requirements:
39
- - - ! '>='
38
+ - - '>='
40
39
  - !ruby/object:Gem::Version
41
40
  version: '0'
42
41
  required_rubygems_version: !ruby/object:Gem::Requirement
43
- none: false
44
42
  requirements:
45
- - - ! '>='
43
+ - - '>='
46
44
  - !ruby/object:Gem::Version
47
45
  version: '0'
48
46
  requirements: []
49
47
  rubyforge_project:
50
- rubygems_version: 1.8.24
48
+ rubygems_version: 2.0.6
51
49
  signing_key:
52
- specification_version: 3
50
+ specification_version: 4
53
51
  summary: navigation_link_to view helper
54
52
  test_files: []