Sha256: e00cadf7befb6c86ac04fdd614b0b805eca1b48456602e42e9b2ce829bbe7eb7

Contents?: true

Size: 681 Bytes

Versions: 6

Compression:

Stored size: 681 Bytes

Contents

<%#
# Money Form Partial

This partial renders a masked input element.
It keeps the (unmasked) value in sync with a sibling hidden field
that gets submitted with the form.

## Local variables:

- `f`:
  A Rails form generator, used to help create the appropriate input fields.
- `field`:
  An instance of Administrate::Field::Money.
%>

<div class="field-unit__label">
  <%= f.label field.attribute %>
</div>
<div class="field-unit__field">
  <%= text_field_tag field.attribute, field.data,
      data: {
        maskmoney: true,
        thousands: field.delimiter,
        decimal: field.separator,
        prefix: field.symbol } %>
  <%= f.hidden_field field.attribute %>
</div>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
administrate-field-money-0.3.0 app/views/fields/money/_form.html.erb
administrate-field-money-0.2.1 app/views/fields/money/_form.html.erb
administrate-field-money-0.2.0 app/views/fields/money/_form.html.erb
administrate-field-money-0.1.2 app/views/fields/money/_form.html.erb
administrate-field-money-0.1.1 app/views/fields/money/_form.html.erb
administrate-field-money-0.1.0 app/views/fields/money/_form.html.erb