AdminBits simplifies creation of sortable & searchable lists found in various dashboards (like admin sections, search forms etc).
- RDoc documentation available on RubyDoc.info
- Source code available on GitHub
- More information, known limitations, and how-tos available on the wiki
- Live demo
- Please report bugs on the issue tracker but read the "getting help" section in the wiki first.
In Rails, for latest stable release add it to your Gemfile:
gem 'admin_bits'
If you are brave enough to live on the edge, or just want to checkout latest version use:
gem 'admin_bits', git: 'https://github.com/detomastah/admin_bits.git'
The easiest way to get started is to user admin_bits generator.
Let's assume that you have model Item
. The following command will create a new Admin::ItemsController
with initial resource:
rails generate admin_bits items
The resource, layout and assets can be freely modified. If there were no errors, one should be able to see new route admin/items
.
Some new files should have appeared, like:
app/models/admin/item_resource.rb
app/controllers/admin/base_controller.rb
app/controllers/admin/items_controller.rb
app/views/layouts/admin.html.erb
If you want to learn more about the generator check its documentation.
Check out your item_resource
class for some hints on how you can customize your Resource. This class contain settings associated with the items resource. You can also check documentation for more information.
You will find resource
private method in resource items_controller.
def resource
@resource ||= Admin::ItemResource.new(params)
end
You can use this for example in your index action:
def index
@items = resource.fetch_for_index
end
admin_bits is maintained and funded by bitmincer & detomastah. Thank you to all the contributors.
admin_bits is copyright © 2013-2015 bitmincer. It is free software, and may be redistributed under the terms specified in the LICENSE file.