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="smSfgpzDwYYC1OZgprWqZGU68qr6CChT8BNJoxxVOigc2iFqOhCp1yQk2BIR35vjXB1JnfOe5T6mw4A9yjcJJw" autocomplete="off" />
<div class=''>
<label class="usa-label" for="text_input_component_preview_article_title">Title</label>
<input 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
6
7
8
9
10
-# haml-lint:disable LineLength
- article = UswdsComponents::TextInputComponentPreview::Article.new(title: params[:value])
-# haml-lint:enable LineLength
- article.errors.add(:title, params[:error1]) if params[:error1].present?
- article.errors.add(:title, params[:error2]) if params[:error2].present?
= form_for article, url: '#', html: { class: 'usa-form' } do |f|
= render UswdsComponents::TextInputComponent.new(form: f, attribute: :title,
hint: params[:hint], success: params[:success])
Param Description Input