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="3KpksZcmqb_pk4m7PJBfx3-BKLR03WuOCqimkVIfU9e62ojFdWWu1i6t5aVGDUTLv5S5cA-ZuHSGxYVJvs7Dww" 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' })