Skip to content

Conversation

@carloslopes
Copy link
Member

Fixes #110

@tkhduracell can you test with this improvement?

@tkhduracell
Copy link

b542544

Yes, it works as expected with checked: [..some ids.. ].

However I think it should work with objects as well, since the collection-attribute is a collection of objects.

collection = [Address.new(id: 1, street: 'St1'), Address.new(id: 2, street: 'St2'), Address.new(id: 3, street: 'St3')]
selected = collection[2..3]
@builder.collection_check_boxes(:misc, collection, :id, :street, checked: selected)

Also the README.md needs to be updated with the checked:

@carloslopes
Copy link
Member Author

Working on it!

@carloslopes
Copy link
Member Author

Done.

I have no idea how to explain this on README 😞

carloslopes added a commit that referenced this pull request Jul 12, 2014
Accept an array of checked values for #collection_check_boxes
@carloslopes carloslopes merged commit d3842da into master Jul 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

collection_check_boxes with checked:

2 participants