Sha256: e08a4983de81a66262eb557f43248d3bb7847022428d258f4015fde92319af8e

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

<% locations = { tokyo: "Tokyo", new_york: "New York", london: "London" } %>
<%= sl_form_for(@user, url: hotwire_forms_path) do |form| %>
  <div>
    <%= form.text_field :name do %>
      <span slot="help-text" style="color: rgb(var(--sl-color-danger-600));">
        <%= @user.errors.full_messages_for(:name).first %>
      </span>
    <% end %>
  </div>

  <div>
    <%= form.color_field :color %>
  </div>

  <div>
    <%= form.range_field :score, min: 0, max: 100, step: 1 %>
  </div>

  <div>
    <%= form.collection_radio_buttons :current_city, locations, :first, :last %>
  </div>

  <div>
    <%= form.collection_select :previous_city, locations, :first, :last, {}, { placeholder: "Select one" } %>
  </div>

  <div>
    <%= form.collection_select :past_cities, locations, :first, :last, {}, { placeholder: "Select two or more", multiple: true, clearable: true } %>
  </div>

  <div>
    <%= form.check_box :remember_me %>
  </div>

  <div>
    <%= form.switch_field :subscribe_to_emails, value: "1" %>
  </div>

  <div>
    <%= form.text_area :description %>
  </div>

  <%= form.submit %>
  <%= form.submit "Submit without Turbo", data: { turbo: false } %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shoelace-rails-0.4.1 test/dummy_app/app/views/hotwire_forms/form.html.erb
shoelace-rails-0.4.0 test/dummy_app/app/views/hotwire_forms/form.html.erb
shoelace-rails-0.3.0 test/dummy_app/app/views/hotwire_forms/form.html.erb