high_voltage 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +17 -0
  2. data/config/routes.rb +2 -2
  3. data/install.rb +7 -1
  4. metadata +8 -3
@@ -29,6 +29,23 @@ After putting something interesting there, you can link to it from anywhere in y
29
29
 
30
30
  Bam.
31
31
 
32
+ Routes
33
+ ------
34
+
35
+ By default, the static page routes will be like /pages/:id (where :id is the view filename).
36
+
37
+ If you want to route to a static page in another location (for example, a homepage), do this:
38
+
39
+ map.root :controller => 'pages', :action => 'show', :id => 'home'
40
+
41
+ In that case, you'd need an app/views/pages/home.html.erb file.
42
+
43
+ Generally speaking, you need to route to the 'show' action with an :id param of the view filename.
44
+
45
+ You'll notice in your config/routes.rb file that the High Voltage routes are generated by:
46
+
47
+ HighVoltage::Routes.draw(map)
48
+
32
49
  Override
33
50
  --------
34
51
 
@@ -1,3 +1,3 @@
1
- Rails.application.routes.draw do |map|
2
- resources :pages, :controller => 'high_voltage/pages', :only => [:show]
1
+ Rails.application.routes.draw do
2
+ resources :pages, :controller => 'high_voltage/pages', :only => :show
3
3
  end
data/install.rb CHANGED
@@ -1 +1,7 @@
1
- # Install hook code here
1
+ line = "HighVoltage::Routes.draw(map)"
2
+ path = "config/routes.rb"
3
+
4
+ puts "inserting #{line} into #{path}"
5
+
6
+ content = File.read(path).sub(/^(end\s*)$/) {|match| " #{line}\n#{match}" }
7
+ File.open(path, 'wb') { |file| file.write(content) }
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_voltage
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 57
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 9
8
- - 0
9
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Dan Croak
@@ -49,23 +50,27 @@ rdoc_options: []
49
50
  require_paths:
50
51
  - lib
51
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
52
54
  requirements:
53
55
  - - ">="
54
56
  - !ruby/object:Gem::Version
57
+ hash: 3
55
58
  segments:
56
59
  - 0
57
60
  version: "0"
58
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
59
63
  requirements:
60
64
  - - ">="
61
65
  - !ruby/object:Gem::Version
66
+ hash: 3
62
67
  segments:
63
68
  - 0
64
69
  version: "0"
65
70
  requirements: []
66
71
 
67
72
  rubyforge_project:
68
- rubygems_version: 1.3.6
73
+ rubygems_version: 1.3.7
69
74
  signing_key:
70
75
  specification_version: 3
71
76
  summary: Simple static page rendering controller