x
1
2
3
4
5
6
<form class="usa-form" id="new_text_input_component_preview_article" action="#" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="_V0XEkfFUpuDBG9qXEe2R2mxwFNhXHR2FWztl1wIdDH7eWlWDLKks7DEFWQCa2jDLZ-uKVVy-5JzXXwzTLv-dw" autocomplete="off" />
<div class=''>
<label class="usa-label" for="text_input_component_preview_article_title">Title</label>
<input required="required" autofocus="autofocus" placeholder="Untitled" class="usa-input" type="text" name="text_input_component_preview_article[title]" id="text_input_component_preview_article_title" />
</div>
</form>
1
2
3
4
5
- article = UswdsComponents::TextInputComponentPreview::Article.new
= form_for article, url: '#', html: { class: 'usa-form' } do |f|
= render UswdsComponents::TextInputComponent.new(form: f, attribute: :title,
input_options: { required: true, autofocus: true, placeholder: 'Untitled' })