Sha256: 1bc629ac4a30b8ec33e3defc7ae29241f36ed499ab8c4cebeb6875f31dfea899

Contents?: true

Size: 936 Bytes

Versions: 67

Compression:

Stored size: 936 Bytes

Contents

<%= content_tag("toggle-switch-input", class: "FormControl-toggleSwitchInput", hidden: @input.hidden?) do %>
  <span style="flex-grow: 1">
    <%= render(Primer::Forms::PrimerBaseComponentWrapper.new(tag: :span, **@input.label_arguments)) do %>
      <%= @input.label %>
    <% end %>

    <%= content_tag(:div, data: { target: "toggle-switch-input.validationElement" }, **@input.validation_arguments) do %>
      <%= content_tag(:span, @input.validation_messages.first, data: { target: "toggle-switch-input.validationMessageElement" }, **@input.validation_message_arguments) %>
    <% end %>

    <div><%= render(Caption.new(input: @input)) %></div>
  </span>
  <%
    csrf = @input.csrf || @view_context.form_authenticity_token(
      form_options: {
        method: :post,
        action: @input.src
      }
    )
  %>
  <%= render(Primer::Alpha::ToggleSwitch.new(src: @input.src, csrf: csrf, **@input.input_arguments)) %>
<% end %>

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
primer_view_components-0.5.1 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.5.0 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.4.0 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.3.1 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.3.0 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.2.0 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.9 lib/primer/forms/toggle_switch.html.erb