x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<form action="/foo" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="L3JOPOaCSNB8gD9NcpYsi-8Lil-YcsaUWt-1BdWB9AA9Btcp_2oV9ztFicr_sbA9oXRIlYRc_B69U5S_ZWh9Og" autocomplete="off" /> <div class="FormControl-spacingWrapper"> <div data-view-component="true"> <div class="FormControl-checkbox-wrap"> <input name="enabled" type="hidden" value="0" autocomplete="off" /><input aria-describedby="caption-52ce1acb-9ebc-4549-8b09-5711f1991565" id="enabled?" class="FormControl-checkbox" type="checkbox" value="1" name="enabled" /> <span class="FormControl-checkbox-labelWrap"> <label for="enabled?" class="FormControl-label"> Enabled </label> <span class="FormControl-caption" id="caption-52ce1acb-9ebc-4549-8b09-5711f1991565"> <p class="my-test-caption">The caption for Enabled?</p> </span> </span> </div> </div> </div></form>1
2
3
<%= primer_form_with(url: "/foo") do |f| %> <%= render(NameWithQuestionMarkForm.new(f)) %><% end %>No notes provided.
No params configured.
app/forms/name_with_question_mark_form.rb
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true# :nodoc:class NameWithQuestionMarkForm < ApplicationForm form do |name_with_question_mark_form| name_with_question_mark_form.check_box( name: :enabled?, label: "Enabled" ) endendapp/forms/name_with_question_mark_form/enabled_caption.html.erb
1
<p class="my-test-caption">The caption for Enabled?</p>