Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Sinatra-based middleware plugin template for displaying a user metrics dashboard in Rails applications
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README.markdown
Rakefile
init.rb
install.rb
screenshot.png
uninstall.rb

README.markdown

UserStats

A Sinatra-based plugin template for displaying a user metrics dashboard in Rails applications.

This plugin provides a starting point for creating a dashboard to view user metrics for an application. Inspired by other metrics dashboards.

In its current form, it assumes you are using Authlogic with a User model and shows some basic information about recent sign ups and, if your User model has a last_request_at attribute, information about active users. Edit the plugin as necessary for your application.

Installation

$ script/plugin install git://github.com/alphabetum/user_stats.git

Add the following to config/environment.rb

config.middleware.use "UserStats::Application"

UserStats depends on Haml and Sinatra:

# config/environment.rb
...
config.gem 'haml'
config.gem 'sinatra'
...

or if using Bundler

# Gemfile
gem 'haml'
gem 'sinatra'

Last, define a User#can_view_user_stats? instance method that returns a boolean indicating whether the user can view stats or not.

If you want to be able to reload the plugin's templates as you edit them, add the following to you development environment:

# config/environments/development.rb
config.reload_plugins = true

Usage

Run script/server and point your browser to http://localhost:3000/__user_stats

Screenshot

Screenshot

Copyright (c) 2010 William Melody, released under the MIT license

Something went wrong with that request. Please try again.