Closed lacco closed 12 years ago
I backported my code to carmen 0.2.13, and now the sorting is fine.
You're right, this is an issue.
I think the way to go with this is to define <=>
on Carmen::Country
, and then have the view helper just call sort on the collection. I'll take a stab at this.
Removing the unpack('U') puts the countries in the correct sort order. A bit confused here about what unpack('U') does ..
Fixed in master.
ruby 1.9.3p194 rails 3.2.3 carmen-rails 1.0.0.beta3
I am a little confused about the sort order of the countries generated by
country_select
. The sorting algorithm from https://github.com/jim/carmen-rails/blob/ada9fc20b65123629fb0831b5997f81f9bfb2a5e/lib/carmen/rails/action_view/form_helper.rb#L88 behaves like this on the command line:As you can see, the order isn't correct because all countries with "G" have the same sort key "[71]".