I need a dropdown of human heights, for example 5'2, 5'3, 5'4, etc. Preferably something like 4'0 to 8'0. Is there a gem or plugin? I can't seem to find one.
Presumably you'd store it in inches anyway, so you could generate your @heights to pass to options_from_collection_for_select like:
(56..112).to_a.map { |inch| { id: inch.to_s, name: (inch/12).floor.to_s+'\''+(inch%12).to_s } }
Perhaps with the inch to string conversion broken out into a helper method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With