No commit activity in last 3 years
No release in over 3 years
Simple Has Many Widget is a RailsAdmin plugin that enables a simpler has_many field than original one (i.e. single list with support for inline add and delete)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.2.4, ~> 1.2
< 6, >= 4.0
 Project Readme

RailsAdminSimpleHasMany

RailsAdminSimpleHasMany is a field type for Rails Admin for has_many associations that do not require a complex multiselect field. RailsAdminSimpleHasMany has been only tested with Mongoid adapter and on Chrome/Safari. I do not expect major issues with other ORMs or browsers, but bugs and enhancements pull requests are welcome!

Example of how the collection field would look like:

RailsAdminSimpleHasMany screenshot1

Usage

Simply add the following gem to your Gemfile:

gem "rails_admin_simple_has_many"

And then run bundle (note: rails_admin should already be in your Gemfile)

Next, add the field as follows in your model

rails_admin do
    field :players, :simple_has_many do
        help 'Please add 12 players'
        orderable true
        required true
    end
end

Note: orderable enables UI controls to move items up and down but you still need to support it in your models, see this for an example using has_many assocaition with Mongoid/MongoDB and this for an example using has_many :through and ActiveRecord.