Sha256: b2f07930e7c3707026531854576d4d26f635818ac215b911598b85ba1de32efb

Contents?: true

Size: 805 Bytes

Versions: 2

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(Yattho::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

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 lib/yattho/forms/form_control.html.erb
yattho_view_components-0.0.1 lib/yattho/forms/form_control.html.erb