Sha256: 109a5eebe99133dcc76824de21fa49de331c1e69091053c2f4cfa60517a92e35

Contents?: true

Size: 833 Bytes

Versions: 14

Compression:

Stored size: 833 Bytes

Contents

<%= content_tag("toggle-switch-input", **@input.input_arguments) do %>
  <span style="flex-grow: 1">
    <%= builder.label(@input.name, **@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)) %>
<% end %>

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
primer_view_components-0.1.8 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.7 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.6 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.5 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.4 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.3 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.2 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.1 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.1.0 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.0.123 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.0.122 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.0.121 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.0.120 lib/primer/forms/toggle_switch.html.erb
primer_view_components-0.0.119 lib/primer/forms/toggle_switch.html.erb