<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>evan (Evan)</title>
    <link>https://ruby-china.org/evan</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>请问 Cache Page 的 title 问题怎么处理？</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;caches_action&lt;/span&gt; &lt;span class="ss"&gt;:index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:expires_in&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;minutes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sx"&gt;%= @products.map(&amp;amp;:name).join(" ")%&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;于是乎就报错了&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 14 Dec 2012 11:36:28 +0800</pubDate>
      <link>https://ruby-china.org/topics/7560</link>
      <guid>https://ruby-china.org/topics/7560</guid>
    </item>
    <item>
      <title>请问 sunspot 怎么配置中文分词？</title>
      <description>&lt;p&gt;gem 'sunspot_rails'
gem 'sunspot_solr'&lt;/p&gt;

&lt;p&gt;我安装了 bundle exec rake sunspot:solr:run 也能跑起来，然后我从&lt;a href="http://code.google.com/p/mmseg4j/downloads/detail?name=mmseg4j-1.8.5.zip" rel="nofollow" target="_blank"&gt;http://code.google.com/p/mmseg4j/downloads/detail?name=mmseg4j-1.8.5.zip&lt;/a&gt; 下载了 mmseg4j，下一步我就不知道该干什么了。好像是要修改 solr/conf/schema.xml，但是整了一下午没成功。求指教&lt;/p&gt;

&lt;p&gt;ps. ruby-china 怎么不用 sunspot 或者 es 呢？现在搜索结果能出来，但是点击进不去帖子还是要翻墙，超级不方便。。。&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Mon, 10 Dec 2012 17:25:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/7443</link>
      <guid>https://ruby-china.org/topics/7443</guid>
    </item>
    <item>
      <title>1-0-1-0-1-12.html 这种查询缓存页面 Rails 怎么做？</title>
      <description>&lt;p&gt;例如：&lt;a href="http://www.360buy.com/products/737-794-1300-0-0-0-0-0-0-0-1-1-1-1-72-33.html" rel="nofollow" target="_blank"&gt;http://www.360buy.com/products/737-794-1300-0-0-0-0-0-0-0-1-1-1-1-72-33.html&lt;/a&gt;
这种应该是 page cache 吧&lt;/p&gt;

&lt;p&gt;cache fragment 到处加这种 unless read_fragment({})  是不是太坑爹了？就算是 lazy load 但是难免 action 里面也用多次调用&lt;/p&gt;

&lt;p&gt;Rails 的 Cache 各大文档都提到 Sweeper，但是实际项目中好像都没用 Sweeper，Rails 的缓存到底该怎么做？&lt;/p&gt;

&lt;p&gt;我感觉 page cache+ajax 才是最好的&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Wed, 21 Nov 2012 20:46:37 +0800</pubDate>
      <link>https://ruby-china.org/topics/6981</link>
      <guid>https://ruby-china.org/topics/6981</guid>
    </item>
    <item>
      <title>服务器日志策略</title>
      <description>&lt;p&gt;搜索不好用。。我记得以前 huacnlee 好像讨论过一次&lt;/p&gt;

&lt;p&gt;只能用 linux 脚本来做？&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 16 Nov 2012 13:39:53 +0800</pubDate>
      <link>https://ruby-china.org/topics/6821</link>
      <guid>https://ruby-china.org/topics/6821</guid>
    </item>
    <item>
      <title>请问 Devise 的 session 过期时间如何设置？</title>
      <description>&lt;p&gt;还有我发现就算我是在不需要登录的页面 session 过期，也会跳到登录页面让我登录，如何解决&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 15 Nov 2012 16:43:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/6790</link>
      <guid>https://ruby-china.org/topics/6790</guid>
    </item>
    <item>
      <title>linux 小白 gem uninstall xxx 显示无权限</title>
      <description>&lt;p&gt;环境：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;RubyGems&lt;/span&gt; &lt;span class="no"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RUBYGEMS&lt;/span&gt; &lt;span class="no"&gt;VERSION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RUBY&lt;/span&gt; &lt;span class="no"&gt;VERSION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2012&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mo"&gt;04&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="n"&gt;patchlevel&lt;/span&gt; &lt;span class="mi"&gt;320&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x86_64&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;linux&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;INSTALLATION&lt;/span&gt; &lt;span class="no"&gt;DIRECTORY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gems&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RUBY&lt;/span&gt; &lt;span class="no"&gt;EXECUTABLE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rubies&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;EXECUTABLE&lt;/span&gt; &lt;span class="no"&gt;DIRECTORY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gems&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;RUBYGEMS&lt;/span&gt; &lt;span class="no"&gt;PLATFORMS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ruby&lt;/span&gt;
    &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x86_64&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;linux&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;GEM&lt;/span&gt; &lt;span class="no"&gt;PATHS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gems&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gems&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt;&lt;span class="vi"&gt;@global&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;GEM&lt;/span&gt; &lt;span class="no"&gt;CONFIGURATION&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="ss"&gt;:update_sources&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="ss"&gt;:verbose&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="ss"&gt;:benchmark&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="ss"&gt;:backtrace&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="ss"&gt;:bulk_threshold&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="no"&gt;REMOTE&lt;/span&gt; &lt;span class="no"&gt;SOURCES&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
     &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="ss"&gt;:/&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rubygems&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;org&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;出错信息：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;ERROR&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="no"&gt;While&lt;/span&gt; &lt;span class="n"&gt;executing&lt;/span&gt; &lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Gem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;FilePermissionError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;You&lt;/span&gt; &lt;span class="n"&gt;don&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;write&lt;/span&gt; &lt;span class="n"&gt;permissions&lt;/span&gt; &lt;span class="n"&gt;into&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="sr"&gt;/usr/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;rvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gems&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ruby&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.9&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;p320&lt;/span&gt; &lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;使用 root 账户又出现：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# gem uninstall xxx&lt;/span&gt;
&lt;span class="no"&gt;The&lt;/span&gt; &lt;span class="n"&gt;program&lt;/span&gt; &lt;span class="s1"&gt;'gem'&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt; &lt;span class="n"&gt;be&lt;/span&gt; &lt;span class="n"&gt;found&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;following&lt;/span&gt; &lt;span class="ss"&gt;packages:
 &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;rubygems1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;
 &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;rubygems1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mf"&gt;9.1&lt;/span&gt;
&lt;span class="no"&gt;Try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;selected&lt;/span&gt; &lt;span class="n"&gt;package&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;该怎么解决？我应该是 rubygems1.8 吧  怎么删掉 rubygems1.9,1 怕删错了环境崩溃。。&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 15 Nov 2012 13:37:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/6780</link>
      <guid>https://ruby-china.org/topics/6780</guid>
    </item>
    <item>
      <title>respond_with (@obj,location:where_path) 怎么传递参数？</title>
      <description>&lt;p&gt;我想把 create 和 update 里面的 params[:back] 参数传递到 show 页面，查了很多资料也不知道怎么做，按理说 create 和 upadate 成功以后应该是 render "show"但是 respond_with 是 redirect 的&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 09 Nov 2012 14:51:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/6636</link>
      <guid>https://ruby-china.org/topics/6636</guid>
    </item>
    <item>
      <title>link_to 想默认加上 target:"_blank"该怎么做?</title>
      <description>&lt;p&gt;看了 api 感觉参数好复杂，不知道该怎么重写&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 09 Nov 2012 13:47:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/6634</link>
      <guid>https://ruby-china.org/topics/6634</guid>
    </item>
    <item>
      <title>Rails 限制失败次数这个功能怎么做？</title>
      <description>&lt;p&gt;比如连续输错 10 次，30 分钟不让再输入之类的。。。&lt;/p&gt;

&lt;p&gt;其实我是来找 gem 的。。&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Mon, 05 Nov 2012 14:43:09 +0800</pubDate>
      <link>https://ruby-china.org/topics/6540</link>
      <guid>https://ruby-china.org/topics/6540</guid>
    </item>
    <item>
      <title>请教后台接受到这种字符%u5468%u8787%u9J99 该怎么处理</title>
      <description>&lt;p&gt;想去数据库里 find 但是查不到，不是中文&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 01 Nov 2012 12:21:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/6453</link>
      <guid>https://ruby-china.org/topics/6453</guid>
    </item>
    <item>
      <title>RubyChina 的 RoutingError 处理</title>
      <description>&lt;p&gt;想给项目加个 404 处理，看了下 RubyChina 的代码：
application_controller.rb&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_404&lt;/span&gt;
  &lt;span class="n"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_403&lt;/span&gt;
  &lt;span class="n"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;render_optional_error_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"404"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;"403"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"422"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"500"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:template&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"/errors/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:format&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:html&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:handler&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:erb&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:status&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"application"&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;render&lt;/span&gt; &lt;span class="ss"&gt;:template&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"/errors/unknown"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:format&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:html&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:handler&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:erb&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="ss"&gt;:status&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:layout&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"application"&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;加上了似乎也不起作用，错误 url 根本就没进 application_controller.rb
似乎跟 routes.rb 有关系，似乎又跟 require 'api'有关系，求指教~ 我用的是 rails3.0&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Wed, 31 Oct 2012 17:12:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/6438</link>
      <guid>https://ruby-china.org/topics/6438</guid>
    </item>
    <item>
      <title>simple_form 非模型属性的输入框生成问题</title>
      <description>&lt;p&gt;后台想接受一个字段在 model 属性中没有，但是想用 simple_form 的风格，只能这样吗？&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"clearfix string"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"string"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;次数&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&amp;gt;
      &amp;lt;div class="input"&amp;gt;&amp;lt;%= text_field_tag :times, params[:times] %&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;或者在 model 中写一个 attr_acceesor :times,  再用：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sx"&gt;%= f.input :times %&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;有没有更好的办法？&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Mon, 29 Oct 2012 13:11:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/6382</link>
      <guid>https://ruby-china.org/topics/6382</guid>
    </item>
    <item>
      <title>RailsCasts 有没有中文字幕？</title>
      <description>&lt;p&gt;实在是听不懂&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 18 Oct 2012 17:36:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/6161</link>
      <guid>https://ruby-china.org/topics/6161</guid>
    </item>
    <item>
      <title>请问 yml 里面&amp;defaults 和&lt;&lt;: *defaults 是什么意思？</title>
      <description>&lt;p&gt;defaults: &amp;amp;defaults
  cool:
    saweet: nested settings
  neat_setting: 24
  awesome_setting: &amp;lt;%= "Did you know 5 + 5 = #{5 + 5}?" %&amp;gt;&lt;/p&gt;

&lt;p&gt;development:
  &amp;lt;&amp;lt;: *defaults
  neat_setting: 800&lt;/p&gt;

&lt;p&gt;test:
  &amp;lt;&amp;lt;: *defaults&lt;/p&gt;

&lt;p&gt;production:
  &amp;lt;&amp;lt;: *defaults&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 21 Sep 2012 18:36:55 +0800</pubDate>
      <link>https://ruby-china.org/topics/5678</link>
      <guid>https://ruby-china.org/topics/5678</guid>
    </item>
    <item>
      <title>请教一下关于生成订单号</title>
      <description>&lt;p&gt;淘宝 订单编号：220883088289889
京东 订单编号：319477253&lt;/p&gt;

&lt;p&gt;uuid 这个 gem 生成的混杂的编号显然不太一样，我也想生成纯数字的，难道直接用 id 吗？&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Mon, 17 Sep 2012 18:29:15 +0800</pubDate>
      <link>https://ruby-china.org/topics/5590</link>
      <guid>https://ruby-china.org/topics/5590</guid>
    </item>
    <item>
      <title>counter_cache 后面的 :inverse_of =&gt; :topics 是什么意思？</title>
      <description>&lt;p&gt;google 无果&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 13 Sep 2012 17:39:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/5528</link>
      <guid>https://ruby-china.org/topics/5528</guid>
    </item>
    <item>
      <title>请问日志里面类似这种 SQL (1.2ms)  describe `articles_users`是哪来的</title>
      <description>&lt;p&gt;缓存了的页面也有好几个这种&lt;/p&gt;

&lt;p&gt;甚至启动 thin 也有：&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Using rack adapter
  SQL (1.3ms)  describe &lt;code&gt;roles_users&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;有办法去掉吗？&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Thu, 13 Sep 2012 11:51:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/5520</link>
      <guid>https://ruby-china.org/topics/5520</guid>
    </item>
    <item>
      <title>mac 不小心把 user/bin/git 删掉了，重装也不行，怎么破？</title>
      <description>&lt;p&gt;是要先 uninstall 再装才行吗&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Mon, 10 Sep 2012 18:41:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/5462</link>
      <guid>https://ruby-china.org/topics/5462</guid>
    </item>
    <item>
      <title>我觉得想学好用好 Rails 必须具备以下 2 点</title>
      <description>&lt;ol&gt;
&lt;li&gt;英文得好，因为多数英文资料都是英文，看不懂英文就等于永远是瞎子摸象，非常痛苦！&lt;/li&gt;
&lt;li&gt;喜欢新的东西，学习能力得强，什么 restful,sass,assets,coffee.....还有各种复杂的 gem devise,simple_form....层出不穷，一般智商低的普通人就算了~&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;研究了一天 simple_form。。。压力巨大&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 07 Sep 2012 19:35:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/5414</link>
      <guid>https://ruby-china.org/topics/5414</guid>
    </item>
    <item>
      <title>看不太懂注释，请问 simple_form 这个:default 是什么意思</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wrappers&lt;/span&gt; &lt;span class="ss"&gt;:default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:class&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="ss"&gt;:hint_class&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:field_with_hint&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:error_class&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:field_with_errors&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;好像随便改成:xxx 也一样&lt;/p&gt;</description>
      <author>evan</author>
      <pubDate>Fri, 07 Sep 2012 11:50:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/5407</link>
      <guid>https://ruby-china.org/topics/5407</guid>
    </item>
  </channel>
</rss>
