Sha256: 476d29f7221de2b9f76478dd80e1fc06b9ea2c64b32ef49166d2ad7837a54979

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

<%#
The following params are the variables that can be used in this partial.

@param form [Wallaby::FormBuilder] custom form object that adds a few helper methods and delegate missing methods to the view
@param object [Wallaby::ResourceDecorator] decorator instance which wraps the resource (e.g. ActiveRecord) instance
@param field_name [String] name of the field
@param value [Object] value of the field
@param metadata [Hash] metadata of the field
%>
<div class="form-group <%= form.error_class field_name %>">
  <%= form.label field_name, metadata[:label] %>
  <div class="row">
    <div class="col-6 col-sm-4">
      <%= form.text_field field_name, class: 'form-control', data: { init: 'colorpicker' } %>
    </div>
  </div>
  <%= form.error_messages field_name %>
  <%= hint_of metadata %>
</div>

<% unless @colorpicker_init %>
  <% @colorpicker_init = true %>
  <% content_for :custom_javascript do %>
    <% javascript_tag do %>
      documentReady('.color', function () {
        $('[data-init="colorpicker"]').minicolors({ theme: 'bootstrap' })
      })
    <% end %>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wallaby-8.0.0 app/views/wallaby/resources/form/_color.html.erb
wallaby-7.0.0 app/views/wallaby/resources/form/_color.html.erb
wallaby-7.0.0.beta2 app/views/wallaby/resources/form/_color.html.erb
wallaby-7.0.0.beta1 app/views/wallaby/resources/form/_color.html.erb