Sha256: 6190ac02e7fcb5a1f866ad53c41c1ceb7d1325486fdff89e88fdde5faee3d27d

Contents?: true

Size: 1.23 KB

Versions: 146

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

# :nodoc:
class FriendForm < ApplicationForm
  form do |friend_form|
    friend_form.group(layout: :horizontal) do |name_group|
      name_group.text_field(name: "first_name", label: "First Name")
      name_group.text_field(name: "last_name", label: "Last Name")
    end
  end
end

# :nodoc:
class FriendTextAreaForm < ApplicationForm
  form do |friend_text_area_form|
    friend_text_area_form.text_area(
      name: "description",
      label: "Describe this wonderful person in loving detail"
    )
  end
end

# :nodoc:
class RadioButtonWithNestedForm < ApplicationForm
  form do |radio_form|
    radio_form.radio_button_group(name: "channel") do |radio_group|
      radio_group.radio_button(value: "online", label: "Online advertisement", caption: "Facebook maybe?")
      radio_group.radio_button(value: "radio", label: "Radio advertisement", caption: "We love us some NPR")
      radio_group.radio_button(value: "friend", label: "From a friend", caption: "Wow, what a good person") do |friend_button|
        friend_button.nested_form do |builder|
          Primer::Forms::FormList.new(
            FriendForm.new(builder),
            FriendTextAreaForm.new(builder)
          )
        end
      end
    end
  end
end

Version data entries

146 entries across 146 versions & 2 rubygems

Version Path
primer_view_components-0.35.2 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.49.1 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.49.0 app/forms/radio_button_with_nested_form.rb
primer_view_components-0.35.1 app/forms/radio_button_with_nested_form.rb
primer_view_components-0.35.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.48.2 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.48.1 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.48.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.47.1 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.47.0 app/forms/radio_button_with_nested_form.rb
primer_view_components-0.34.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.46.1 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.46.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.45.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.44.3 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.44.2 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.44.1 app/forms/radio_button_with_nested_form.rb
primer_view_components-0.33.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.44.0 app/forms/radio_button_with_nested_form.rb
openproject-primer_view_components-0.43.1 app/forms/radio_button_with_nested_form.rb