Skip to content

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

License

Notifications You must be signed in to change notification settings

xwmx/user_stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages