Giter Club home page Giter Club logo

rails_admin_grid's Introduction

RailsAdminGrid

Gem Version

RailsAdminGrid is a custom collection action for RailsAdmin that displays objects in a grid with thumbnails. It provides an alternative to the default list view provided in RailsAdmin.

Preview

alt tag

Installation

Add the following to your Gemfile before rails_admin:

gem 'rails_admin_grid'

Configuration

Global

You must add the custom action to the list of actions in your global RailsAdmin configuration. The default, with RailsAdminGrid added, looks like this:

# config/initializers/rails_admin.rb
RailsAdmin.config do |config|
  config.actions do
    # root actions
    dashboard                     # mandatory
    # collection actions 
    index                         # mandatory
    new
    export
    history_index
    bulk_delete
    # member actions
    show
    edit
    delete
    history_show
    show_in_app

    grid                          # RailsAdminGrid
  end
end

Since RailsAdminGrid works best for displaying models with an associated picture, it may not be desirable to use on every model. You can restrict the models for which the action is available using the steps described here.

Model

To configure RailsAdminGrid's behavior on a specific model, you must include a grid block in your model configuration, as such:

rails_admin do
  grid do
    thumbnail_method do
      :thumb
    end
  end
end

The only information RailsAdmin requires to function properly is a thumbnail_method, a method which it will use to retrieve the corresponding thumbnail for the object. Visible fields and copes can also be configured in this block.

These properties must be specified in the list block instead of the grid block:

  • items_per_page
  • sort_reverse
  • sort_by

rails_admin_grid's People

Contributors

colavitam avatar janrenz avatar patleb avatar

Watchers

 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.