Sha256: 120d7a36fd12fda8647c6646c626849506d360cb9717ebb695a3395eef6ea4fd

Contents?: true

Size: 805 Bytes

Versions: 13

Compression:

Stored size: 805 Bytes

Contents

<% if @input.form_control? %>
  <%= content_tag(:div, **@form_group_arguments) do %>
    <% if @input.label %>
      <%= builder.label(@input.name, **@input.label_arguments) do %>
        <%= @input.label %>
        <% if @input.required? %>
          <span aria-hidden="true">*</span>
        <% end %>
      <% end %>
    <% end %>
    <%= content %>
    <% if @input.need_validation_element? %>
      <%= content_tag(:div, **@input.validation_arguments) do %>
        <%= render(Primer::Beta::Octicon.new(icon: :"alert-fill", size: :xsmall, aria: { hidden: true })) %>
        <%= content_tag(:span, @input.validation_messages.first, **@input.validation_message_arguments) %>
      <% end %>
    <% end %>
    <%= render(Caption.new(input: @input)) %>
  <% end %>
<% else %>
  <%= content %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
primer_view_components-0.1.3 lib/primer/forms/form_control.html.erb
primer_view_components-0.1.2 lib/primer/forms/form_control.html.erb
primer_view_components-0.1.1 lib/primer/forms/form_control.html.erb
primer_view_components-0.1.0 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.123 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.122 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.121 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.120 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.119 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.118 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.117 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.116 lib/primer/forms/form_control.html.erb
primer_view_components-0.0.115 lib/primer/forms/form_control.html.erb