Code Monkey home page Code Monkey logo

administrate-field-paper_trail's Introduction

AdministrateFieldPaperTrail

Gem CI

An Administrate plugin to show record change histories from PaperTrail.

Requirements

  • Ruby on Rails version >= 5.0
  • Administrate version >= 0.2.2
  • PaperTrail version >= 2.7.2

Installation

Make sure you already setup PaperTrail properly in your project. Add administrate-field-paper_trail to your Gemfile:

gem 'administrate-field-paper_trail'

And then execute:

$ bundle install

Usage

Add to your UserDashboard:

ATTRIBUTE_TYPES = {
  changeset: Field::PaperTrail.with_options(excluded_attributes: %w[created_at updated_at]),
}

The excluded_attributes option takes an array of string of the attributes you want to exclude from the result. Default excluded attributes are: id, created_at, and updated_at.

Then show the field in your show page like so:

SHOW_PAGE_ATTRIBUTES = %i[
  changeset
]

Currently, only support to show changes in the show page. Contribution will be appreciated.

To Do

  • Show record changes information in the show page
  • Show count of changes of each records in the index page
  • Add i18n support for the result message
  • Add i18n support for date/time value

Contributing

  1. Contribution are welcome (codes, suggestions, and bugs)
  2. Please test your code: bundle exec rspec
  3. Please document your code
  4. Bug reports and pull requests are welcome on GitHub at https://github.com/IrvanFza/administrate-field-paper_trail

License

MIT License


Based on the Administrate::Field::Image template

administrate-field-paper_trail's People

Contributors

irvanfza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.