Permalink
Browse files

Merge pull request #1 from garethr/master

Corrections for using custom views
  • Loading branch information...
2 parents 6b8ba9e + 2a7a332 commit 9725f1eb958b7e007297fb8d2b96efdf08640481 @aphyr aphyr committed Aug 10, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −1 README.markdown
  2. +1 −1 example/config.rb
  3. +3 −3 example/controller/graphs.rb
  4. +2 −2 lib/riemann/dash.rb
View
@@ -32,7 +32,7 @@ config[:client][:host] = 'my.ustate.server'
You'll probably want a more specific dashboard:
``` ruby
-config[:view] = 'my/custom/view'
+config[:views] = 'my/custom/view/directory'
```
Then you can write your own index.erb (and other views too, if you like). I've
View
@@ -8,7 +8,7 @@
config[:controllers] << 'controller'
# Use the local view directory instead of the default
-config[:view] = 'view'
+config[:views] = 'views'
# Serve static files from this directory
public_dir 'public'
@@ -59,7 +59,7 @@ def graph_opts(h = {})
}.merge h.select { |k, v|
PARAMS.include? k.to_s
}
-
+
o.inject([]) { |unpacked, pair|
case pair[1]
when Array
@@ -89,11 +89,11 @@ def graph_opts(h = {})
else
TYPES[type] or error 404
end
-
+
@graphs = @graphs.map do |g|
g.merge request.params
end
- erubis :graphs, layout: :plain
+ erubis :graphs, layout => :plain
end
end
View
@@ -5,12 +5,12 @@
module Riemann
class Dash < Sinatra::Base
# A little dashboard sinatra application.
-
+
require 'yaml'
require 'find'
require 'erubis'
require 'sass'
-
+
def self.config
@config ||= {
:client => {},

0 comments on commit 9725f1e

Please sign in to comment.