<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>opensoul.org - acts_as_money Comments</title>
  <id>tag:opensoul.org,2008:/2006/11/13/acts_as_money/comments</id>
  <generator uri="http://mephistoblog.com" version="0.7.3">Mephisto Noh-Varr</generator>
  <link href="http://opensoul.org/2006/11/13/acts_as_money/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
  <updated>2008-03-03T21:45:43Z</updated>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>nathaniel</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5394</id>
    <published>2008-03-03T21:45:43Z</published>
    <updated>2008-03-03T21:45:43Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by nathaniel</title>
<content type="html">&lt;p&gt;I am having a hell of time with acts_as_money and rails 2.0.2.  Everytime I edit a record and click save, whatever price is in my price field gets two extra zeros.  I am forced to trim two zeros off of every price field everytime I open a record for editing, even if all I wanted to do was adjust a different field.&lt;/p&gt;


	&lt;p&gt;I have no idea why this is happening.  Has anyone had this sort of issue happen to them?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5332</id>
    <published>2008-02-21T03:49:03Z</published>
    <updated>2008-02-21T03:49:03Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;Srgt &lt;span class=&quot;caps&quot;&gt;PPD&lt;/span&gt;,&lt;/p&gt;


	&lt;p&gt;The &#8221;$&#8221; is coming from the money gem.  If you want the amount without it, you can just call &lt;code&gt;#to_s&lt;/code&gt; on the money object.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Srgt PPD</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5327</id>
    <published>2008-02-20T10:37:13Z</published>
    <updated>2008-02-20T10:37:13Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Srgt PPD</title>
<content type="html">&lt;p&gt;How do you remove the dollar sign from the format method? I tried to delete it, but nothing happend. Search within the code of the plugin but couldn&#8217;t find any more &#8221;$&#8221; signs.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>JM</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:5023</id>
    <published>2008-01-15T19:16:07Z</published>
    <updated>2008-01-15T19:16:07Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by JM</title>
<content type="html">&lt;p&gt;I haven&#8217;t tried this myself&#8230; does this plugin work with Rails 2.0?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2891</id>
    <published>2007-05-07T14:16:41Z</published>
    <updated>2007-05-07T14:16:41Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;LBo,&lt;/p&gt;


	&lt;p&gt;There&#8217;s not exactly a way to do it with the acts_as_money plugin, but if you look at the source for the plugin, it&#8217;s very trivial.  Mainly, it makes use of a patch to &lt;code&gt;composed_of&lt;/code&gt;, which I have also &lt;a href=&quot;http://source.collectiveidea.com/public/rails/plugins/composed_of_conversion/&quot;&gt;packaged as a plugin&lt;/a&gt;.  In your situation, I would just install the &lt;code&gt;composed_of&lt;/code&gt; plugin patch, then do something like the following in your model:&lt;/p&gt;


&lt;pre&gt;
composed_of :price, :class_name =&amp;gt; 'Money',
    :mapping =&amp;gt; [%w(cents cents), %w(currency currency)] do |hash|
  Money.new(&quot;#{hash[:dollars]}.#{hash[:cents]}&quot;, hash[:currency])
end
&lt;/pre&gt;

	&lt;p&gt;And then in your views:&lt;/p&gt;


&lt;pre&gt;
text_field_tag 'mymodel[price][dollars]'
text_field_tag 'mymodel[price][cents]'
&lt;/pre&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>LBo</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2889</id>
    <published>2007-05-06T22:19:11Z</published>
    <updated>2007-05-06T22:19:11Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by LBo</title>
<content type="html">&lt;p&gt;Hi Brandon,&lt;/p&gt;


	&lt;p&gt;My users have to fill in a price with two seperate input fields. One for a full amount and one for cents. Together it makes the whole price.&lt;/p&gt;


	&lt;p&gt;What would be the best way to take care of the separate formvalues in combination with this plugin?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>John Ward</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2521</id>
    <published>2007-03-17T06:49:03Z</published>
    <updated>2007-03-17T06:49:03Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by John Ward</title>
<content type="html">&lt;p&gt;Brandon, 
Thanks for the reply.&lt;/p&gt;


	&lt;p&gt;The reasons I was considering were as its been posted as a patch it will eventually end up in core rails.&lt;/p&gt;


	&lt;p&gt;John&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2519</id>
    <published>2007-03-16T21:11:19Z</published>
    <updated>2007-03-16T21:11:19Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon</title>
<content type="html">&lt;p&gt;John,&lt;/p&gt;


	&lt;p&gt;When I initially released it, acts_as_money actually didn&#8217;t use the aggregations patch. But the code was doing some ugly string eval stuff. It was only a couple lines, but ugly none-the-less.  I added the aggregations patch to demonstrate its usefulness (no one cared).&lt;/p&gt;


	&lt;p&gt;I ended up packaging the &lt;a href=&quot;http://source.collectiveidea.com/public/rails/plugins/composed_of_conversion&quot;&gt;patch as a plugin&lt;/a&gt;, so I could remove it from acts_as_money, but I&#8217;m guessing people would find it more annoying to have to install 2 plugins.
Unless it&#8217;s getting in the way, I think I&#8217;m going to leave it as is. Got any good reasons to remove it?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>John Ward</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:2518</id>
    <published>2007-03-16T20:40:36Z</published>
    <updated>2007-03-16T20:40:36Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by John Ward</title>
<content type="html">&lt;p&gt;I think it would be a good idea to package the acts_as_money without the composed_of patch.&lt;/p&gt;


	&lt;p&gt;Had you considered that?&lt;/p&gt;


	&lt;p&gt;This is not a reflection on the quality or otherwise, just that it would appear separate from the money code.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Brandon Keepers</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:719</id>
    <published>2007-01-10T04:31:32Z</published>
    <updated>2007-01-10T04:31:32Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Brandon Keepers</title>
<content type="html">&lt;p&gt;Haig,&lt;/p&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt;.  I&#8217;ll add it to the code.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://opensoul.org/">
    <author>
      <name>Haig Didizian</name>
    </author>
    <id>tag:opensoul.org,2006-11-13:658:718</id>
    <published>2007-01-09T19:33:20Z</published>
    <updated>2007-01-09T19:33:20Z</updated>
    <category term="work"/>
    <link href="http://opensoul.org/2006/11/13/acts_as_money" rel="alternate" type="text/html"/>
    <title>Comment on 'acts_as_money' by Haig Didizian</title>
<content type="html">&lt;p&gt;Brandon, can you tell us how you&#8217;ve licensed this plugin? I can&#8217;t seem to find anything in the code about it&#8230; Thanks!!&lt;/p&gt;</content>  </entry>
</feed>
