Select 在 haml 中具有不同的值

Select with different values in haml

我正在尝试使用 jQuery 的 select2 创建一个 select 框,其中包含选项列表但具有不同的值。现在,这些值与显示的值相等。

例如,选项应为 "Runner",而该选项的值应为 "Runner - Individual"。我无法获得包含选项值的选项数组。

.formfield
  = f.label :registration_type, "Select a registration type"
  = f.select :registration_type, options_for_registration, { :include_blank => true, :selected => session[:zombie_run].try(:[], :registration_type) }, { :class => 'required', :style => 'width: 16em;' }


def options_for_registration
    options = []
    today = Time.current.to_date
    if today <= @event.event_date
      options << 'Runner' unless @event.runner_waves.all?(&:full?)
      options << 'Team' unless @event.runner_waves.all?(&:full?) || @event.registration_closed?
      options << 'Zombie' unless @event.zombie_shifts.all?(&:full?)
      options << 'Volunteer' unless @event.volunteer_shifts.all?(&:full?)
    end

    options
end

提前致谢!

options << ['Runner - Individual', 'Runner'] unless @event.runner_waves.all?(&:full?)
# ...