RailsAdmin Build Status Dependency Status Click here to lend your support to: RailsAdmin and make a donation at www.pledgie.com !

RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.

It started as a port of MerbAdmin to Rails 3 and was implemented as a Ruby Summer of Code project by Bogdan Gaza with mentors Erik Michaels-Ober, Yehuda Katz, Luke van der Hoeven, and Rein Henrichs.

Announcements

  • for those with rake db:migrate errors, update to master and check that you see the line: "[RailsAdmin] RailsAdmin initialization disabled by default." when you launch the task. If not (or if migrations still don't work), open a ticket with an application on Github that can reproduce the issue.

  • config.models do ... end is deprecated (note the 's' to models, config.model(MyModel) do .. end is fine), for performance reasons (forces early loading of all application's models). Duplicate to each model instead, before next release. If you really need the old behavior:

config.models.each do |m|
  config.model m do
    # <<<< here goes your code
  end
end

Features

  • Display database tables
  • Create new data
  • Easily update data
  • Safely delete data
  • Custom actions
  • Automatic form validation
  • Search and filtering
  • Export data to CSV/JSON/XML
  • Authentication (via Devise)
  • Authorization (via Cancan)
  • User action history (internally or via PaperTrail)
  • Supported ORMs
    • ActiveRecord
    • Mongoid [new]

Demo

Take RailsAdmin for a test drive with sample data. (Source code.)

Installation

In your Gemfile, add the following dependencies:

gem 'fastercsv' # Only required on Ruby 1.8 and below
gem 'rails_admin'

Run:

$ bundle install

And then run:

$ rails g rails_admin:install

This generator will install RailsAdmin and Devise if you don't already have it installed. Devise is strongly recommended to protect your data from anonymous users. Note: If you do not already have Devise installed, make sure you remove the registerable module from the generated user model.

It will modify your config/routes.rb, adding:

mount RailsAdmin::Engine => '/admin', :as => 'rails_admin' # Feel free to change '/admin' to any namespace you need.

Note: Your RailsAdmin namespace cannot match your Devise model name, or you will get an infinite redirect error. The following will generate infinite redirects.

mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
devise_for :admins

Consider renaming your RailsAdmin namespace:

mount RailsAdmin::Engine => '/rails_admin', :as => 'rails_admin'
devise_for :admins

See #715 for more details.

It will also add an intializer that will help you getting started. (head for config/initializers/rails_admin.rb)

Finally run:

$ bundle exec rake db:migrate

Optionally, you may wish to set up Cancan, PaperTrail, CKeditor, CodeMirror

More on that in the Wiki

Usage

Start the server:

$ rails server

You should now be able to administer your site at http://localhost:3000/admin.

Configuration

All configuration documentation has moved to the wiki: https://github.com/sferik/rails_admin/wiki

Screenshots

Dashboard view Delete view List view Nested view Polymorphic edit view

Support

If you have a question, please check this README, the wiki, and the list of known issues.

If you still have a question, you can ask the official RailsAdmin mailing list.

If you think you found a bug in RailsAdmin, you can submit an issue.

Contributing

In the spirit of free software, everyone is encouraged to help improve this project.

Here are some ways you can contribute:

  • by using alpha, beta, and prerelease versions
  • by reporting bugs
  • by suggesting new features
  • by writing or editing documentation
  • by writing specifications
  • by writing code (no patch is too small: fix typos, add comments, clean up inconsistent whitespace)
  • by refactoring code
  • by fixing issues
  • by reviewing patches
  • financially

Submitting an Issue

We use the GitHub issue tracker to track bugs and features. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted. When submitting a bug report, please include a Gist that includes a stack trace and any details that may be necessary to reproduce the bug, including your gem version, Ruby version, and operating system. Ideally, a bug report should include a pull request with failing specs.

Submitting a Pull Request

  1. Fork the repository.
  2. Create a topic branch.
  3. Add specs for your unimplemented feature or bug fix.
  4. Run bundle exec rake spec. If your specs pass, return to step 3.
  5. Implement your feature or bug fix.
  6. Run bundle exec rake spec. If your specs fail, return to step 5.
  7. Run open coverage/index.html. If your changes are not completely covered by your tests, return to step 3.
  8. Add, commit, and push your changes.
  9. Submit a pull request.

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations: