Closed vzelenko closed 9 years ago
Having same issue too
also same issue
after investigating, it looks like this has been resolved on master, but not on 3.0.3
Ah, that makes sense. I was just looking at master code, and could not find what made it follow the ID order. :)
@vzelenko AFAIU its problem of chrome\opera, not this gem. I've fixed this by setting collection like
{"V1":"some value"}
instead of {"1":"some_value"}
. And on request from input - i remove these strings
:+1:
@avdept: Maybe I am wrong, but I need the dropdown sorted in its natural insert order (in my case, by 'value'). The helper somehow reorders it by 'key' instead, at least on the production stable gem version.
@vzelenko check this thread http://stackoverflow.com/questions/11045331/javascript-jquery-parsing-json-in-same-order
Same problem here, inside gem, there is JSON.parse(collection)
, and after parse - browser sorts(no idea why) by key. And to prevent from sorting, made impossible for browser order by key, because my keys were strings "V1"
instead of "1"
OK, so I have confirmed that MASTER branch has this issue fixed. Tested in Chrome, on macbook pro. Closing the issue.
Thanks everyone for the feedback.
@seuros Any chance to cut a new release so I don't need to use the master branch? I need this fix...
sure. I will do that today. Thanks for the ping.
I am using the master branch and still having this problem. Has anyone fixed it?
I am using best_in_place gem for rendering a list of values as so
<%= best_in_place model, :method, as: :select, collection: [ ['', '