Sha256: 1c77c292e3865485b6368b5468cf9008fcbe4c8870ca47c3b1fa4ffefa9fad1c

Contents?: true

Size: 983 Bytes

Versions: 149

Compression:

Stored size: 983 Bytes

Contents

# frozen_string_literal: true

# :nodoc:
class MultiInputForm < ApplicationForm
  form do |my_form|
    my_form.radio_button_group(name: :country, label: "Country") do |radio_group|
      radio_group.radio_button(label: "USA", value: "US")
      radio_group.radio_button(label: "Canada", value: "CA")
    end

    my_form.multi(name: :region, label: "Region") do |region|
      region.select_list(name: :states) do |state_list|
        state_list.option(label: "California", value: "CA")
        state_list.option(label: "Washington", value: "WA")
        state_list.option(label: "Oregon", value: "OR")
      end

      region.select_list(hidden: true, name: :provinces) do |province_list|
        province_list.option(label: "British Columbia", value: "BC")
        province_list.option(label: "Alberta", value: "AB")
        province_list.option(label: "Saskatchewan", value: "SK")
      end
    end

    my_form.submit(name: :submit, label: "Submit", scheme: :primary)
  end
end

Version data entries

149 entries across 149 versions & 3 rubygems

Version Path
openproject-primer_view_components-0.15.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.14.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.13.1 app/forms/multi_input_form.rb
primer_view_components-0.13.2 app/forms/multi_input_form.rb
primer_view_components-0.13.1 app/forms/multi_input_form.rb
openproject-primer_view_components-0.13.0 app/forms/multi_input_form.rb
primer_view_components-0.13.0 app/forms/multi_input_form.rb
primer_view_components-0.12.0 app/forms/multi_input_form.rb
primer_view_components-0.11.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.12.1 app/forms/multi_input_form.rb
primer_view_components-0.10.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.11.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.10.0 app/forms/multi_input_form.rb
primer_view_components-0.9.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.9.1 app/forms/multi_input_form.rb
openproject-primer_view_components-0.9.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.8.0 app/forms/multi_input_form.rb
primer_view_components-0.8.0 app/forms/multi_input_form.rb
primer_view_components-0.7.0 app/forms/multi_input_form.rb
openproject-primer_view_components-0.7.0 app/forms/multi_input_form.rb