spree/spree — pull request #3631 by laurens (2013-08-24 18:00:10+00:00)
Title: Cleanup UI for selecting zone members

The current implementation of adding/removing `zone_members` has some UI issues

- When adding a new member an unstyled selctbox is shown
- This select box is unaware of previously added zone_members
- The list of zone members can grown long
- There are two x-Buttons which is confusing (one for removing an entry, and one for resetting the select box)

![bildschirmfoto 2013-08-24 um 01 42 07](https://f.cloud.github.com/assets/94158/1021177/ca19bc28-0ce6-11e3-9d4f-a56b1c5ed917.png)

This PR addresses those issues and simplifies both the code and the UI

![bildschirmfoto 2013-08-24 um 01 41 19](https://f.cloud.github.com/assets/94158/1021171/15060bde-0ce6-11e3-825c-df5ccd11d3a9.png)

Adding and removing zone_members is now done via virtual attributes `country_ids`/`country_ids=` and `state_ids`/`state_ids=`.

If it would be ok to change the API accordingly we could refactor a bit more and remove the `accepts_nested_attributes_for :zone_members` and get rid of the `remove_defunct_members` method

Note: zone_members are destroyed and recreated on each save. Are there extensions that rely on preserved ids of zone_members?