RailsAdminMydash Gem Version

A rails_admin alternative dashboard. It overrides the default dashboard component.

Features:

  • last 3 records for each model (useful to reach the last items easily)

  • Google Analytics data if enabled

  • admin notices if enabled (to show informations to the users)

  • auditing / history table if enabled

  • no breadcrump and nav tabs on the dashboard

  • no counters progress bars (minor performance improvement)

Installation

  • Add the gem to Gemfile (after rails_admin gem): gem 'rails_admin_mydash'

  • Execute bundle

Google Analytics

# In config.actions block:
dashboard do
  ga_key 'XXX.apps.googleusercontent.com'
  ga_chart_id 'ga:YYYYYYYYY'
  ga_start_date '60daysAgo'
  ga_end_date '30daysAgo'
  ga_metrics 'ga:sessions,ga:pageviews'
end

Options:

  • ga_key: required - CLIENT_ID parameter (obtained from Google API Client Libraries - ID client OAuth 2.0)

  • ga_chart_id: optional - chart to show, if not specified the selector is shown

  • ga_start_date: optional - starting date, default: '30daysAgo'

  • ga_end_date: optional - ending date, default: 'yesterday'

  • ga_metrics: optional - type of data to show, default: 'ga:sessions'

Admin notices

  • Create and apply a migration:

rails g migration CreateAdminNotices message:string published:boolean

  • Create a model AdminNotice

  • Enable the option in rails_admin config:

# In config.actions block:
dashboard do
  admin_notices 'AdminNotice'
end
  • Add some messages: AdminNotice.new( message: 'Just a test', published: true ).save

Options

  • admin_notices [String]: model to use to show admin messages

  • last_records [Integer]: number of records to show per model

  • models [String array]: list of models to show (es. ['Category', 'Post', 'Tag'])

Notes

  • For each record to show a name field or method is used

Preview

preview

Contributors