title: Money-Rails Gem: How to make a select list for all currencies?
body: <p>I'm using the <a href="https://github.com/RubyMoney/money-rails" rel="nofollow noreferrer">money-rails gem</a> and want to show in my view a list of different currencies but the code I have now isn't working.</p>
  <p>I have my <code>Price</code> model and the fields <code>in_cents</code> and <code>currency</code>:</p>
  <pre><code>create_table :prices do |t|
    t.integer :in_cents, default: 0, null: false
    t.string :currency, default: 'USD', null: false
  </code></pre>
  <p>Now according to the <a href="https://github.com/RubyMoney/money" rel="nofollow noreferrer">Money gem</a> and Money-Rails docs I had to do something like:</p>
  <pre><code>class Price &lt; ActiveRecord::Base
  
    monetize :in_cents, as: &quot;amount&quot;, with_model_currency: :in_cents_currency
  
    def all_currencies(hash)
      hash.keys
    end
  </code></pre>
  <p>Than my view with simple form gem:</p>
  <pre><code>= f.input :currency, collection: all_currencies(Money::Currency.table)
  = f.input :amount, required: false
  </code></pre>
  <p>But this gives me the error:</p>
  <pre><code>undefined method `all_currencies' for #&lt;#&lt;Class:0xd154124&gt;:0xd15bab4&gt;
  </code></pre>
  <p>Why?</p>
  <p>P.S.</p>
  <p>I want to show the ISO Code and the name like <code>United States Dollar (USD)</code>.</p>