<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>yingjie_xiao (xiao yingjie)</title>
    <link>https://ruby-china.org/yingjie_xiao</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>有人熟悉 redmine 里人 call_hook 吗</title>
      <description>&lt;p&gt;在.rhtml 文件里：&amp;lt;%= call_hook :view_account_login_top %&amp;gt;
这样写是什么意思？小菜求高手指点。&lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Fri, 30 May 2014 10:58:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/19640</link>
      <guid>https://ruby-china.org/topics/19640</guid>
    </item>
    <item>
      <title>怎么将 Rails 4.1.1 降到 Rails 3.2.*</title>
      <description>&lt;p&gt;现在用 gem install rails 安装 rails 都是默认安装的版本是 4.1.1，我想安装的是 3.2，怎么指定版本安装，或者是设置默认版本呢，求解&lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Sun, 18 May 2014 08:41:46 +0800</pubDate>
      <link>https://ruby-china.org/topics/19336</link>
      <guid>https://ruby-china.org/topics/19336</guid>
    </item>
    <item>
      <title>关于 options_for_select 的问题，求解</title>
      <description>&lt;p&gt;&lt;code&gt;options_for_select([
      categories.each do |category|
        [category.id, category.name]
      end
    ],value)&lt;/code&gt;
categories 是一个对象数组，我上面这种形式只能获取到第一个对象，其他的获取不到，它的正确用法是这样的吧：
&lt;code&gt;options_for_select([[l(:label_all_time), 'all'],
                        [l(:label_today), 'today'],
                        [l(:label_yesterday), 'yesterday'],
                        [l(:label_this_week), 'current_week'],
                        [l(:label_last_week), 'last_week']],
                        value)&lt;/code&gt;
但是&lt;code&gt;[category.id, category.name]&lt;/code&gt;后面加&lt;code&gt;,&lt;/code&gt;号的话，程序会报错&lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Fri, 23 Aug 2013 10:31:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/13542</link>
      <guid>https://ruby-china.org/topics/13542</guid>
    </item>
    <item>
      <title>[ruby on rails] 明明存到 hash 的为一个对象，怎么取出来就是一个 Array 啦</title>
      <description>&lt;p&gt;rails 项目中 app/helper/****_helper.rb 这是个 module
     usertimesheetMap = Hash.new
     entries.each do |entry|
      usertimesheet = usertimesheetMap[entry.user.id.to_i]
      if !usertimesheetMap.has_key?(entry.user.id.to_i)
        usertimesheet = UserTimesheet.new
        usertimesheetMap[entry.user.id.to_i] = usertimesheet
      end
      usertimesheet = usertimesheetMap[entry.user.id.to_i]
      custom = CustomValue.new
      custom = custom.get_custom_value_by_userid(entry.user.id.to_i)
      usertimesheet.hrid= custom.value.to_s
      usertimesheet.username= entry.user
      usertimesheet.project= entry.project&lt;/p&gt;
&lt;h2 id="custom = custom.get_location_by_userid(entry.user.id.to_i)"&gt;      custom = custom.get_location_by_userid(entry.user.id.to_i)&lt;/h2&gt;
&lt;p&gt;class UserTimesheet&lt;/p&gt;

&lt;p&gt;def hrid
    &lt;a href="/hrid" class="user-mention" title="@hrid"&gt;&lt;i&gt;@&lt;/i&gt;hrid&lt;/a&gt;
   end&lt;/p&gt;

&lt;p&gt;def hrid=(value)
    &lt;a href="/hrid" class="user-mention" title="@hrid"&gt;&lt;i&gt;@&lt;/i&gt;hrid&lt;/a&gt; = value
   end
   def username
    &lt;a href="/username" class="user-mention" title="@username"&gt;&lt;i&gt;@&lt;/i&gt;username&lt;/a&gt;
   end&lt;/p&gt;

&lt;p&gt;def username=(value)
    &lt;a href="/username" class="user-mention" title="@username"&gt;&lt;i&gt;@&lt;/i&gt;username&lt;/a&gt; = value
   end&lt;/p&gt;

&lt;p&gt;def CWDays
    &lt;a href="/CWDays" class="user-mention" title="@CWDays"&gt;&lt;i&gt;@&lt;/i&gt;CWDays&lt;/a&gt;
   end&lt;/p&gt;

&lt;p&gt;def CWDays=(value)
    &lt;a href="/CWDays" class="user-mention" title="@CWDays"&gt;&lt;i&gt;@&lt;/i&gt;CWDays&lt;/a&gt; = value
   end&lt;/p&gt;

&lt;p&gt;def NWDays
    &lt;a href="/NWDays" class="user-mention" title="@NWDays"&gt;&lt;i&gt;@&lt;/i&gt;NWDays&lt;/a&gt;
   end&lt;/p&gt;

&lt;p&gt;def NWDays=(value)
    &lt;a href="/NWDays" class="user-mention" title="@NWDays"&gt;&lt;i&gt;@&lt;/i&gt;NWDays&lt;/a&gt; = value
   end&lt;/p&gt;
&lt;h2 id="end"&gt;end&lt;/h2&gt;
&lt;p&gt;运行结果如下：
undefined method `hrid' for #&lt;a rel="nofollow" target="_blank"&gt;Array:0xb55892b4&lt;/a&gt; &lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Thu, 31 Jan 2013 15:43:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/8517</link>
      <guid>https://ruby-china.org/topics/8517</guid>
    </item>
    <item>
      <title>想请教下 ||=与=的区别，||=是在什么情况下使用比较合适</title>
      <description>&lt;p&gt;想请教下||=与=的区别，||=是在什么情况下使用比较合适，请大侠帮帮忙&lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Thu, 20 Dec 2012 09:07:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/7710</link>
      <guid>https://ruby-china.org/topics/7710</guid>
    </item>
    <item>
      <title>哪位兄弟修改过开源项目 RedMine 的源代码</title>
      <description>&lt;p&gt;我目前需要在 RedMine 中添加新的功能，但是需要在原来的页面添加，不知到谁这样做过，我是需要在 Issues&amp;gt;&amp;gt;&amp;gt;log time 中添加新功能，不知到有谁做过这样的&lt;/p&gt;</description>
      <author>yingjie_xiao</author>
      <pubDate>Wed, 19 Dec 2012 16:20:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/7693</link>
      <guid>https://ruby-china.org/topics/7693</guid>
    </item>
  </channel>
</rss>
