Skip to content

Mixed collection member types for select input #960

Closed
hammady opened this Issue Jul 16, 2013 · 4 comments

2 participants

@hammady
hammady commented Jul 16, 2013

I want to show 2 sets of objects in a select input separated by "---- New values ----".
This is what I did:

separator = ['---- New categories ----', nil]
@collection = objects1 + [separator] + objects2

However, the separator lines appears as blank. Removing objects1 and objects2 displays the separator correctly, yet alone. Isn't it possible to mix in different types in the collection array?
I am using mongoid, if that's important.

@justinfrench
Owner

I'm not sure why this isn't working, haven't looked through the code yet. Did you try separator = ['---- New categories ----',''] (an empty string) by any chance? Would you be able to create a pull request with a failing spec and maybe even a patch?

@hammady
hammady commented Jul 17, 2013

An empty string has the same problem. I will try looking into the code.

@hammady
hammady commented Jul 17, 2013

Just created a pull request with a failing spec.

@justinfrench
Owner

Closing this, as it's an issue with standard Rails select helper. Details and suggested work-arounds can be found in #961.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.