high_voltage 0.9.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -38,6 +38,10 @@ This will also work, if you like the more explicit style:
38
38
 
39
39
  link_to "About", page_path(:id => "about")
40
40
 
41
+ You can nest pages in a directory structure, if that makes sense from a URL perspective for you:
42
+
43
+ link_to "Q4 Reports", page_path("about/corporate/policies/HR/en_US/biz/sales/Quarter-Four")
44
+
41
45
  Bam.
42
46
 
43
47
  Routes
@@ -17,7 +17,12 @@ class HighVoltage::PagesController < ApplicationController
17
17
  protected
18
18
 
19
19
  def current_page
20
- "pages/#{params[:id].to_s.downcase}"
20
+ "pages/#{clean_path}"
21
+ end
22
+
23
+ def clean_path
24
+ path = Pathname.new "/#{params[:id]}"
25
+ path.cleanpath.to_s[1..-1]
21
26
  end
22
27
 
23
28
  end
@@ -1,3 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- resources :pages, :controller => 'high_voltage/pages', :only => :show
2
+ match '/pages/*id' => 'high_voltage/pages#show', :as => :page
3
3
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_voltage
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 9
9
- - 4
10
- version: 0.9.4
5
+ version: 1.0.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - Dan Croak
@@ -21,7 +16,7 @@ autorequire:
21
16
  bindir: bin
22
17
  cert_chain: []
23
18
 
24
- date: 2011-04-09 00:00:00 -04:00
19
+ date: 2011-06-29 00:00:00 -04:00
25
20
  default_executable:
26
21
  dependencies: []
27
22
 
@@ -54,18 +49,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
49
  requirements:
55
50
  - - ">="
56
51
  - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
52
  version: "0"
61
53
  required_rubygems_version: !ruby/object:Gem::Requirement
62
54
  none: false
63
55
  requirements:
64
56
  - - ">="
65
57
  - !ruby/object:Gem::Version
66
- hash: 3
67
- segments:
68
- - 0
69
58
  version: "0"
70
59
  requirements: []
71
60