A simple dashboard of records created this week, this month, and all time, mountable as a Rails Engine.
-
Add gem to
Gemfile
:gem 'stat_board'
-
Mount engine (in
config/routes.rb
):YourApp::Application.routes.draw do mount StatBoard::Engine, :at => "/stats"
-
Configure models (in
config/initializers/stat_board.rb
):StatBoard.models = [User, Post, Comment]
Models can also be listed as strings if you encounter any loading order issues.
In config/initializers/stat_board.rb
:
-
Title
StatBoard.title = "YourApp Stats"
-
Basic Authentication
StatBoard.username = "user" StatBoard.password = "pass"
-
Displaying Data Graphically (true by default)
StatBoard.display_graph = true
-
Data cache lifetime (1 hour by default)
StatBoard.cache_lifetime = 1.day
- Models can be specified as strings rather than constants if you encounter loading order issues.
- If you're using the Asset Pipeline, you'll need to add
stat_board/bootstrap.css
to your precompile paths. - If you have
config.assets.initialize_on_precompile
set tofalse
, then you will need to addstat_board/highcharts.js
to your precompile paths.
Happily accepting contributions to improve StatBoard. To contribute, fork, add your thing, add some specs, and send a pleasantly worded pull request.
In order to setup the databases locally, you'll need to: bundle exec rake db:migrate app:db:test:prepare
StatBoard is released under the MIT License. See MIT-LICENSE for further details.