Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<form action="/foo" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="C5bYkeVVheEIx8Oot4Q3AMUiTAdmsMOhuqQ2G6v5yexGlo6G8R8p3g6YxyCtHzLrrtOTQUy1-5_Nmb7bH0oPSg" autocomplete="off" />
<div class="FormControl-spacingWrapper">
<div class="FormControl-checkbox-wrap">
<input name="enabled" type="hidden" value="0" autocomplete="off" /><input aria-describedby="caption-467f4d46-f38e-4162-9892-dfb5b9ee6055" class="FormControl-checkbox" type="checkbox" value="1" name="enabled" id="enabled" />
<span class="FormControl-checkbox-labelWrap">
<label class="FormControl-label" for="enabled">
Enabled
</label> <span class="FormControl-caption" id="caption-467f4d46-f38e-4162-9892-dfb5b9ee6055">
<p class="my-test-caption">The caption for Enabled?</p>
</span>
</span>
</div>
</div>
</form>
1
2
3
<%= primer_form_with(url: "/foo") do |f| %>
<%= render(NameWithQuestionMarkForm.new(f)) %>
<% end %>

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"
)
end
end

app/forms/name_with_question_mark_form/enabled_caption.html.erb

1
<p class="my-test-caption">The caption for Enabled?</p>