<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>aloha (ntastrea)</title>
    <link>https://ruby-china.org/aloha</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>decimal 与 float</title>
      <description>&lt;p&gt;新建的 model，在 migrate 声明成 decimal，:scale=&amp;gt;1 
写 99.9 存进去的值是 99.9，但是取出来 view 里面显示的就是 99.90000000000001，rails console 取出来也是 99.90000000000001
是不是 rails 会自动把 decimal 转成 float，如果要显示 1 位小数，是不是每次都要调 xxx.round()  &lt;/p&gt;</description>
      <author>aloha</author>
      <pubDate>Fri, 06 Jul 2012 12:50:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/4160</link>
      <guid>https://ruby-china.org/topics/4160</guid>
    </item>
    <item>
      <title>批量生成 scaffold</title>
      <description>&lt;p&gt;请问大家，可不可以写一个 rake script 批量生成一堆 scaffold
像这样
:task =&amp;gt; :environment do
    rails g scaffold A title:string content:text
    rails g scaffold B ....
    ....
end&lt;/p&gt;

&lt;p&gt;但报错说
undefined local variable or method `string' for main:Object&lt;/p&gt;

&lt;p&gt;不知道该怎么写，求指导，谢谢~  &lt;/p&gt;</description>
      <author>aloha</author>
      <pubDate>Thu, 14 Jun 2012 15:09:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/3807</link>
      <guid>https://ruby-china.org/topics/3807</guid>
    </item>
  </channel>
</rss>
