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="hG-vO2rSIxhHuGJQ_rxfnBKLEyuQQH0VvzIMHfSBrZSDCDLnPtLY_3FLfqI1DaJyDAr3-ICfo8Dh8d8wKOFBBw" 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' })