Sha256: e99de10782b1da57d92c6e5136ee6f04ebc66975c0769dc05238e083c39c61cd

Contents?: true

Size: 993 Bytes

Versions: 160

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

# :nodoc:
class CustomCitiesForm < ApplicationForm
  form do |custom_cities_form|
    custom_cities_form.text_field(
      name: :custom_cities,
      label: "Custom cities",
      description: "A space-separated list of cities"
    )
  end
end

# :nodoc:
class CheckBoxWithNestedForm < ApplicationForm
  form do |check_form|
    check_form.check_box_group(name: :city_categories) do |check_group|
      check_group.check_box(
        value: "capital",
        label: "Capital",
        description: "The capital city"
      )
      check_group.check_box(
        value: "populous",
        label: "Most-populous",
        description: "The five most-populous cities"
      )
      check_group.check_box(
        value: "custom",
        label: "Custom",
        description: "A custom list of cities"
      ) do |custom_check_box|
        custom_check_box.nested_form do |builder|
          CustomCitiesForm.new(builder)
        end
      end
    end
  end
end

Version data entries

160 entries across 160 versions & 3 rubygems

Version Path
primer_view_components-0.36.5 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.52.2 app/forms/check_box_with_nested_form.rb
primer_view_components-0.36.4 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.52.1 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.52.0 app/forms/check_box_with_nested_form.rb
primer_view_components-0.36.3 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.51.0 app/forms/check_box_with_nested_form.rb
primer_view_components-0.36.2 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.50.1 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.50.0 app/forms/check_box_with_nested_form.rb
primer_view_components-0.36.1 app/forms/check_box_with_nested_form.rb
primer_view_components-0.36.0 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.49.2 app/forms/check_box_with_nested_form.rb
primer_view_components-0.35.2 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.49.1 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.49.0 app/forms/check_box_with_nested_form.rb
primer_view_components-0.35.1 app/forms/check_box_with_nested_form.rb
primer_view_components-0.35.0 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.48.2 app/forms/check_box_with_nested_form.rb
openproject-primer_view_components-0.48.1 app/forms/check_box_with_nested_form.rb