title: How to get full price for money gem
body: <p>i am using the <a href="https://github.com/RubyMoney/money" rel="nofollow">money gem</a> and i wanted to know <strong>how i can get prices like 23.45, 10.00, 0.32 to show in one field as dollar.cents?</strong> I want my cents field to become just Price (money or dollars &amp; cents). </p>
  
  <p>Here is my code:</p>
  
  <p><strong>My model with money gem composed_of:</strong></p>
  
  <pre><code>class Price &lt; ActiveRecord::Base
      attr_accessible :name, :date, :cents, :currency
  
      belongs_to :user
  
      validates :name,       :presence =&gt; true,
                             :length   =&gt; { :maximum =&gt; 50 }
  
      validates :currency,   :presence =&gt; true
      validates :cents,      :presence =&gt; true
      validates :date,       :presence =&gt; true
  
      default_scope :order =&gt; 'prices.created_at DESC'
  
      composed_of :price,
          :class_name =&gt; "Money",
          :mapping =&gt; [%w(cents cents), %w(currency currency_as_string)],
          :constructor =&gt; Proc.new { |cents, currency| Money.new(cents || 0, currency || Money.default_currency) },
          :converter =&gt; Proc.new { |value| value.respond_to?(:to_money) ? value.to_money : raise(ArgumentError, "Can't convert #{value.class} to Money") }
  end
  </code></pre>
  
  <p><strong>The form (i cut out parts for brevity):</strong></p>
  
  <pre><code>  &lt;div class="field"&gt;
      &lt;%= f.label :name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :name %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :date %&gt;&lt;br /&gt;
      &lt;%= f.date_select :date %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :cents %&gt;&lt;br /&gt;
      &lt;%= f.text_field :cents %&gt;
    &lt;/div&gt;
    &lt;&gt;&lt;div class="field"&gt;
      &lt;%= f.label :currency %&gt;&lt;br /&gt;
      &lt;%= f.select(:currency,major_currencies(Money::Currency::TABLE), 
      {:include_blank =&gt; 'Select a Currency'}) %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>My migration or Price Table:</strong></p>
  
  <pre><code>class CreatePrices &lt; ActiveRecord::Migration
    def self.up
      create_table :prices do |t|
        t.integer :user_id
        t.string :name
        t.date :date
        t.integer :cents, :default =&gt; 0
        t.string :currency
  </code></pre>
  
  <p>It seems like i am missing a column or something. It is even suppose to be cents alone? Not sure so i need your help.</p>
  
  <p>Thank you for taking the time.</p>