<% amount_attr ||= :amount %>
<% currency_attr ||= :currency %>
<% currency ||= nil %>

<div class="input-group js-number-with-currency">
  <div class="input-group-addon currency-selector-symbol"></div>
  <%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: ''), class: 'form-control currency-selector-amount' %>
  <% if currency %>
    <div class="input-group-addon currency-selector-addon" data-currency="<%= currency %>">
      <%= ::Money::Currency.find(currency).iso_code %>
    </div>
  <% else %>
    <div class="input-group-addon currency-selector-addon">
      <%= f.select currency_attr, ::Money::Currency.all.map(&:iso_code), {include_blank: true}, {class: 'currency-selector'} %>
    </div>
  <% end %>
</div>

<% amount_attr ||= :amount %>
<% currency_attr ||= :currency %>
<% currency ||= nil %>
<% required ||= nil %>

<div class="input-group js-number-with-currency">
  <div class="input-group-addon currency-selector-symbol"></div>
  <%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: ''), class: 'form-control currency-selector-amount', required: required %>
  <% if currency %>
    <div class="input-group-addon currency-selector-addon" data-currency="<%= currency %>">
      <%= ::Money::Currency.find(currency).iso_code %>
    </div>
  <% else %>
    <div class="input-group-addon currency-selector-addon">
      <%= f.select currency_attr, ::Money::Currency.all.map(&:iso_code), {include_blank: true}, {class: 'currency-selector', required: required} %>
    </div>
  <% end %>
</div>

Allow specifying required on number_with_currency
Allow specifying required on number_with_currency
