x
1
2
3
4
5
6
7
<div class="space-y-2">
<label class="label block " for="form_component_preview_test_model_first_name">First name</label>
<input class="w-full max-w-sm border border-zinc-900" type="text" name="form_component_preview_test_model[first_name]" id="form_component_preview_test_model_first_name" />
<p class="form_errors">
⚠️ First name can't be blank
</p>
</div>
1
2
3
custom_model = TestModel.new
custom_model.valid?
render(TextFieldComponent.new(form: form(model: custom_model), method: :first_name, label: I18n.t(:first_name)))