Skip to content
History rollback for rails_admin with paper_trail
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fixed refresh button on history page (fix from rails_admin pull reque… Dec 12, 2018
config/locales Added Brazilian Portuguese Translations Feb 18, 2019
lib Bump to v1.0.2 Feb 19, 2019
screenshots Initial commit Mar 5, 2015
.gitignore Initial commit Mar 5, 2015 Create Dec 19, 2017
MIT-LICENSE Initial commit Mar 5, 2015
Rakefile Bumped to v0.0.2 Mar 5, 2015
rails_admin_history_rollback.gemspec Update dependencies Jul 9, 2016

Rails Admin History Rollback

Gem Version Dependency Status Code Climate

RailsAdmin extension for enabling users to easily visualise and revert their history audit created by the PaperTrail gem.


To enable rails_admin_history_rollback, add the following to your Gemfile ensuring it is added after rails_admin:

gem 'rails_admin'
gem 'rails_admin_history_rollback'

It should go without saying that this plugin also requires the paper_trail gem.

E.g. gem 'paper_trail'


Simply enable paper_trail on your model --with-changes --with-associations and set up as usual by following the paper_trail instructions.

rails generate paper_trail:install --with-changes --with-associations

In the rails_admin.rb initializer, uncomment the following lines to enable auditing:



You may also need to require "paper_trail" in application.rb

As pointed out in issue #8, paper_trail master branch and release v5.0.0 (when available) causes session issues. Login is reset by devise; paper_trail tries to access to the current_user variable before devise (airblade/paper_trail#556).

The fix is to manually add set_paper_trail_whodunnit before_action as advised here: (

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  before_action :set_paper_trail_whodunnit


History view

Modal view

About Jemcode


This repository is maintained and funded by Jemcode Limited. We are available for hire.

You can’t perform that action at this time.