Not sure if this is the best way, but you can try something like this
@heights = (4..7).to_a.collect{|o| 0.upto(11).to_a.collect{|k| ["#{o.to_s+'\'' + k.to_s}",o.to_s + k.to_s]}}.inject([]){|s,v| s | v}
OR better
@heights = (4..7).to_a.collect{|o| 0.upto(11).to_a.collect{|k| ["#{o.to_s+'\'' + k.to_s}",o.to_s + k.to_s]}}.flatten(1)
this will give a structure like <
[["4'0", "40"], ["4'1", "41"], ["4'2", "42"], ["4'3", "43"], ["4'4", "44"]]
, , :
@heights.map { |name, id| OpenStruct.new(:value => id, :name => name) }
,
, OpenStruct,
require 'ostruct'
select:
<%= select_tag "Height", options_from_collection_for_select(@heights,'value','name'), html_options = { :onChange=> "height_changed();"} %>