<commit_before># RailsAdminSimpleHasMany

RailsAdminSimpleHasMany is a field type for [Rails Admin](https://github.com/sferik/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](https://s3.amazonaws.com/aimannajjar.com/assets/images/portfolio/rails_admin_simple_has_many_sm.png)

## Usage

Simply add the following gem to your Gemfile:
```code
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

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

<commit_msg>Updated README - orderable option<commit_after># RailsAdminSimpleHasMany

RailsAdminSimpleHasMany is a field type for [Rails Admin](https://github.com/sferik/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](https://s3.amazonaws.com/aimannajjar.com/assets/images/portfolio/rails_admin_simple_has_many_sm_orderable.png)

## Usage

Simply add the following gem to your Gemfile:
```code
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

```ruby
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 [here](https://github.com/sferik/rails_admin/wiki/Has-many-%3Athrough-association) for an example using a similar widget.


{'fraction_non_alphanumeric': 0.06881340979267754, 'fraction_numerical': 0.003970004411116012, 'mean_word_length': 4.845360824742268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '34475', 'n_tokens_mistral': 681, 'n_tokens_neox': 644, 'n_words': 257}