<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>zfben.com</title>
    <link>http://zfben.com/</link>
    <pubDate>Fri, 12 Mar 2010 02:04:24 GMT</pubDate>
    <description>zfben.com</description>
    <language>zh-cn</language>
    <item>
      <title>&#23490;&#38745;&#23567;&#31449;2.0&#30340;View</title>
      <link>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84View</link>
      <description>&lt;p&gt;&#32593;&#31449;&#30340;&#21069;&#21488;&#24067;&#23616;&#22914;&#19979;&#65306;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;header&#65306;&#22836;&#37096;&#65292;&#21253;&#25324;&#39030;&#37096;&#30340;&#25628;&#32034;&#26639;&#21644;&#23548;&#33322;&#26639;&lt;/li&gt;
    &lt;li&gt;content&#65306;&#20027;&#20307;&#37096;&#20998;
    &lt;ul&gt;
        &lt;li&gt;leftcol&#65306;&#24038;&#20391;&#23548;&#33322;&#26639;&lt;/li&gt;
        &lt;li&gt;contentcol&#65306;&#20869;&#23481;&#26639;
        &lt;ul&gt;
            &lt;li&gt;content_area&#65306;&#27491;&#25991;&#20869;&#23481;&lt;/li&gt;
            &lt;li&gt;rightcol&#65306;&#20391;&#36793;&#26639;&#65292;&#30446;&#21069;&#20165;Follow me&#30340;&#31449;&#22806;&#38142;&#25509;&lt;/li&gt;
            &lt;li&gt;content_footer&#65306;&#36820;&#22238;&#39030;&#37096;&#30340;&#25353;&#38062;&#21450;&#32763;&#39029;&#38142;&#25509;&#65288;&#21487;&#29992;&#24773;&#20917;&#19979;&#65289;&lt;/li&gt;
        &lt;/ul&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;footer&#65306;&#24213;&#37096;&#65292;&#30446;&#21069;&#20165;&#31616;&#21333;&#30340;&#29256;&#26435;&#20449;&#24687;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&#20854;&#20013;&#27491;&#25991;&#20869;&#23481;&#65292;&#25105;&#26681;&#25454;&#30446;&#21069;&#32593;&#31449;&#24067;&#23616;&#30340;&#19981;&#21516;&#65292;&#32454;&#20998;&#20026;&#19977;&#31867;&#65306;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;post&#65306;&#26085;&#24535;&#65292;&#29992;&#20110;&#25991;&#31456;&#27491;&#25991;&lt;/li&gt;
    &lt;li&gt;list&#65306;&#21015;&#34920;&#65292;&#29992;&#20110;&#25991;&#31456;&#21015;&#34920;&#65292;&#22914;&#39318;&#39029;&#31561;&lt;/li&gt;
    &lt;li&gt;page&#65306;&#39029;&#38754;&#65292;&#29305;&#27530;&#39029;&#38754;&#65292;&#22914;Tag Cloud&#39029;&#38754;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;CSS&#37319;&#29992;&#20102;YUI3-reset&#65292;&#27809;&#26377;&#20351;&#29992;css hack&#26469;&#20860;&#23481;IE6&#12290;&lt;/p&gt;
&lt;p&gt;CSS&#25991;&#20214;&#22320;&#22336;&#20026;&#65306;&lt;a href="http://assets.zfben.com/stylesheets/all.css" target="_blank"&gt;http://assets.zfben.com/stylesheets/all.css&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 12 Mar 2010 02:04:24 GMT</pubDate>
      <guid>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84View</guid>
    </item>
    <item>
      <title>Ruby on Rails&#25216;&#24039;&#65306;&#33719;&#21462;&#23545;&#35937;&#25968;&#32452;&#20013;&#30340;&#26041;&#27861;</title>
      <link>http://zfben.com/blog/Ruby%20on%20Rails%E6%8A%80%E5%B7%A7%EF%BC%9A%E8%8E%B7%E5%8F%96%E5%AF%B9%E8%B1%A1%E6%95%B0%E7%BB%84%E4%B8%AD%E7%9A%84%E6%96%B9%E6%B3%95</link>
      <description>&lt;pre class="brush: ruby"&gt;
# &#24120;&#29992;&#26041;&#27861;authors = Post.all.map{ |p| p.author }# &#20063;&#21487;&#20197;&#36825;&#20040;&#20889;authors = Post.all.map do |p|  p.authorend# &#32456;&#26497;&#20889;&#27861;authors = Post.all.map(&amp;amp;:author)&lt;/pre&gt;</description>
      <pubDate>Sun, 07 Mar 2010 03:15:54 GMT</pubDate>
      <guid>http://zfben.com/blog/Ruby%20on%20Rails%E6%8A%80%E5%B7%A7%EF%BC%9A%E8%8E%B7%E5%8F%96%E5%AF%B9%E8%B1%A1%E6%95%B0%E7%BB%84%E4%B8%AD%E7%9A%84%E6%96%B9%E6%B3%95</guid>
    </item>
    <item>
      <title>&#23490;&#38745;&#23567;&#31449;2.0&#30340;Model&#20043;Dict&#21450;&#20854;&#23427;</title>
      <link>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84Model%E4%B9%8BDict%E5%8F%8A%E5%85%B6%E5%AE%83</link>
      <description>&lt;p&gt;&amp;nbsp;Dict&#23601;&#26159;&#23383;&#20856;&#30340;&#24847;&#24605;&#65292;&#29616;&#22312;&#26242;&#26102;&#20882;&#20805;Tag&#30340;&#21151;&#33021;&#65292;&#35745;&#21010;&#20170;&#21518;&#20250;&#25226;&#31867;&#20284;&#30340;Dict&#21512;&#24182;&#25104;&#19968;&#20010;Tag&#12290;&lt;/p&gt;
&lt;p&gt;Dict&#30340;&#32467;&#26500;&#22914;&#19979;&#65306;&lt;/p&gt;
&lt;pre class="brush: ruby"&gt;
  create_table &amp;quot;dicts&amp;quot;, :force =&amp;gt; true do |t|
    t.text     &amp;quot;name&amp;quot;
    t.text     &amp;quot;slug&amp;quot;
    t.integer  &amp;quot;count&amp;quot;
    t.datetime &amp;quot;created_at&amp;quot;
    t.datetime &amp;quot;updated_at&amp;quot;
  end
&lt;/pre&gt;
&lt;p&gt;&#26041;&#27861;&#22914;&#19979;&#65306;&lt;/p&gt;
&lt;pre class="brush: ruby"&gt;
  has_many :post_dict
  
  def get_posts
    posts_id = Post.find(
      :conditions =&amp;gt; ['post_dicts.dict_id = ?', self.id],
      :include =&amp;gt; :post_dict
    )
  end
&lt;/pre&gt;
&lt;p&gt;&#38500;&#20102;Dict&#21644;Post&#22806;&#65292;&#23601;&#21097;&#19979;PostFrom&#21644;PostDict&#30340;&#32467;&#26500;&#36824;&#27809;&#20171;&#32461;&#65292;&#23427;&#20204;&#30340;&#32467;&#26500;&#20998;&#21035;&#20026;&#65306;&lt;/p&gt;
&lt;pre class="brush: ruby"&gt;
  create_table &amp;quot;post_dicts&amp;quot;, :force =&amp;gt; true do |t|
    t.integer  &amp;quot;post_id&amp;quot;
    t.integer  &amp;quot;dict_id&amp;quot;
    t.integer  &amp;quot;count&amp;quot;
    t.datetime &amp;quot;created_at&amp;quot;
    t.datetime &amp;quot;updated_at&amp;quot;
  end

  create_table &amp;quot;post_froms&amp;quot;, :force =&amp;gt; true do |t|
    t.integer  &amp;quot;post_id&amp;quot;
    t.text     &amp;quot;table&amp;quot;
    t.integer  &amp;quot;pid&amp;quot;
    t.text     &amp;quot;url&amp;quot;
    t.datetime &amp;quot;created_at&amp;quot;
    t.datetime &amp;quot;updated_at&amp;quot;
  end
&lt;/pre&gt;
&lt;p&gt;&#30456;&#23545;&#20110;Post&#65292;&#36825;&#20123;&#37117;&#31616;&#21333;&#24456;&#22810;&lt;/p&gt;</description>
      <pubDate>Thu, 04 Mar 2010 07:39:30 GMT</pubDate>
      <guid>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84Model%E4%B9%8BDict%E5%8F%8A%E5%85%B6%E5%AE%83</guid>
    </item>
    <item>
      <title>&#23490;&#38745;&#23567;&#31449;2.0&#30340;Model&#20043;Post</title>
      <link>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84Model%E4%B9%8BPost</link>
      <description>&lt;p&gt;Post&#23601;&#26159;&#26085;&#24535;&#65292;&#25968;&#25454;&#24211;&#32467;&#26500;&#22914;&#19979;&#65306;&lt;/p&gt;
&lt;pre class="brush: ruby"&gt;
&amp;nbsp;&amp;nbsp;create_table &amp;quot;posts&amp;quot;, :force =&amp;gt; true do |t|
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.text &amp;nbsp; &amp;nbsp; &amp;quot;title&amp;quot; #&#26085;&#24535;&#26631;&#39064;
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.text &amp;nbsp; &amp;nbsp; &amp;quot;content&amp;quot; #&#26085;&#24535;&#20869;&#23481;
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.text &amp;nbsp; &amp;nbsp; &amp;quot;content_nohtml&amp;quot; #&#21435;&#38500;html&#20195;&#30721;&#21518;&#30340;&#26085;&#24535;&#20869;&#23481;
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.text &amp;nbsp; &amp;nbsp; &amp;quot;types&amp;quot; #&#26085;&#24535;&#31867;&#22411;&#65292;&#30446;&#21069;&#26377;3&#31181;&#65306;blog&#65292;delicious&#21644;topic
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.text &amp;nbsp; &amp;nbsp; &amp;quot;status&amp;quot; #&#26085;&#24535;&#29366;&#24577;&#65292;&#20063;&#26159;3&#31181;&#29366;&#24577;&#65306;publish&#65292;draft&#21644;delete
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.datetime &amp;quot;created_at&amp;quot;
&amp;nbsp;&amp;nbsp; &amp;nbsp;t.datetime &amp;quot;updated_at&amp;quot;
&amp;nbsp;&amp;nbsp;end
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp; &#21487;&#33021;&#20320;&#20250;&#22855;&#24618;&#20026;&#20309;&#20250;&#26377;content_nohtml&#36825;&#20010;&#22855;&#24618;&#30340;&#25968;&#25454;&#21015;&#65292;&#36825;&#20010;&#21015;&#30340;&#20316;&#29992;&#20027;&#35201;&#26377;&#20004;&#20010;&#65306;&#19968;&#20010;&#26159;&#29992;&#20110;&#25628;&#32034;&#65292;&#21487;&#20197;&#36991;&#20813;&#25628;&#32034;&#21040;html&#20195;&#30721;&#65292;&#21478;&#19968;&#20010;&#23601;&#26159;&#29983;&#25104;&#25991;&#31456;&#25688;&#35201;&#12290; Post&#26377;&#22914;&#19979;&#26041;&#27861;&#65306;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;self.get_posts&#65306;&#33719;&#21462;&#26085;&#24535;&#21015;&#34920;&lt;/li&gt;
    &lt;li&gt;get_summary&#65306;&#33719;&#21462;&#26085;&#24535;&#30340;&#25688;&#35201;&lt;/li&gt;
    &lt;li&gt;get_tags&#65306;&#33719;&#21462;&#26085;&#24535;&#30340;Tags&#21015;&#34920;&lt;/li&gt;
    &lt;li&gt;get_similar&#65306;&#33719;&#21462;&#30456;&#20851;&#26085;&#24535;&#21015;&#34920;&lt;/li&gt;
    &lt;li&gt;self._search&#65306;&#25628;&#32034;&#26085;&#24535;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&#35814;&#32454;&#20195;&#30721;&#22914;&#19979;&#65306;&lt;/p&gt;
&lt;pre class="brush: ruby"&gt;
class Post &amp;lt; ActiveRecord::Base
&amp;nbsp;&amp;nbsp;has_one :post_from
&amp;nbsp;&amp;nbsp;has_many :post_dict
&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;def self.get_posts(*options)
&amp;nbsp;&amp;nbsp; &amp;nbsp;options = Hash.options(
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;options,
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:types =&amp;gt; 'all',
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;:page =&amp;gt; 1
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&amp;nbsp;&amp;nbsp; &amp;nbsp;)
&amp;nbsp;&amp;nbsp; &amp;nbsp;page = Hash.options(
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;:per_page =&amp;gt; 10,
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;:select =&amp;gt; 'posts.id, posts.title, posts.content_nohtml, posts.types, posts.created_at',
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;:conditions =&amp;gt; 'posts.status = &amp;quot;publish&amp;quot;',
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;:order =&amp;gt; 'posts.updated_at DESC'
&amp;nbsp;&amp;nbsp; &amp;nbsp;)
&amp;nbsp;&amp;nbsp; &amp;nbsp;page[:page] = options[:page]
&amp;nbsp;&amp;nbsp; &amp;nbsp;case options[:types]
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;when 'search'
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;keyword = '%' &amp;lt;&amp;lt; options[:keyword] &amp;lt;&amp;lt; '%'
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;page[:conditions] = [page[:conditions] &amp;lt;&amp;lt; ' AND (title LIKE ? OR content_nohtml LIKE ?)', keyword, keyword]
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;when 'tag'
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;page[:conditions] = [page[:conditions] &amp;lt;&amp;lt; ' AND post_dicts.dict_id = ?', options[:id]]
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;page[:include] = :post_dict
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;when 'all'
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;else
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;page[:conditions] = [page[:conditions] &amp;lt;&amp;lt; ' AND types = ?', options[:types]]
&amp;nbsp;&amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp;Post.paginate(page)
&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;def get_summary
&amp;nbsp;&amp;nbsp; &amp;nbsp;unless self.content_nohtml.blank?
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return self.content_nohtml.delete('&amp;quot;').scan(/./)[0, 200].join('')
&amp;nbsp;&amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;def get_tags
&amp;nbsp;&amp;nbsp; &amp;nbsp;tags_id = PostDict.get_dict_id(self.id)
&amp;nbsp;&amp;nbsp; &amp;nbsp;if tags_id.blank?
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;return nil
&amp;nbsp;&amp;nbsp; &amp;nbsp;else
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Dict.find(tags_id)
&amp;nbsp;&amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;def get_similar(*options)
&amp;nbsp;&amp;nbsp; &amp;nbsp;unless self.post_dict.blank?
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;options = Hash.options(options,{:limit =&amp;gt; 5})
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;dicts = self.post_dict.map{|x| x.dict_id}
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;sim = Array.new
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Post.id_is_not(self.id).each do |sub_post|
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if sub_post.status != 'publish' || sub_post.post_dict.blank?
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;next
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum = 0
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sub_dicts = sub_post.post_dict.map{|x| x.dict_id}
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum_dicts = dicts &amp;amp; sub_dicts
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if sum_dicts.length &amp;lt; 1
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;next
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum_dicts.each do |sum_dict|
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;main_count = PostDict.post_id_is(self.id).dict_id_is(sum_dict).first.count
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sub_count = PostDict.post_id_is(sub_post.id).dict_id_is(sum_dict).first.count
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count = 0
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;count = ([main_count, sub_count].sort![-1] - (main_count - sub_count).abs)
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if count &amp;gt; 0
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum = sum + count
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sim[sim.length] = [sum, sub_post]
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if sim.length &amp;gt; 0
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sim.sort!{|x,y| x[0] &amp;lt;=&amp;gt; y[0]}
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return sim.map{|x| x[1]}[0,options[:limit]]
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp;end
&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;def self._search(keyword, *options)
&amp;nbsp;&amp;nbsp; &amp;nbsp;keyword = '%' &amp;lt;&amp;lt; keyword &amp;lt;&amp;lt; '%'
&amp;nbsp;&amp;nbsp; &amp;nbsp;options = Hash.options(options)
&amp;nbsp;&amp;nbsp; &amp;nbsp;find = Hash.options(
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;:conditions =&amp;gt; ['status = &amp;quot;publish&amp;quot; AND (title LIKE ? OR content_nohtml LIKE ?)', keyword, keyword]
&amp;nbsp;&amp;nbsp; &amp;nbsp;)
&amp;nbsp;&amp;nbsp; &amp;nbsp;if options[:limit].blank? == false
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;find[:limit] = options[:limit]
&amp;nbsp;&amp;nbsp; &amp;nbsp;end
&amp;nbsp;&amp;nbsp; &amp;nbsp;Post.find(:all, find)
&amp;nbsp;&amp;nbsp;end
end
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp; &#27426;&#36814;&#22823;&#23478;&#25351;&#20986;&#19981;&#36275;&#20043;&#22788; :)&lt;/p&gt;</description>
      <pubDate>Wed, 03 Mar 2010 11:07:17 GMT</pubDate>
      <guid>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%9A%84Model%E4%B9%8BPost</guid>
    </item>
    <item>
      <title>&#23490;&#38745;&#23567;&#31449;2.0&#29256;&#35797;&#36816;&#34892;</title>
      <link>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%89%88%E8%AF%95%E8%BF%90%E8%A1%8C</link>
      <description>&lt;p&gt;&#20043;&#25152;&#20197;&#34987;&#31216;&#20026;2.0&#29256;&#65292;&#26159;&#22240;&#20026;&#26412;&#31449;&#30340;&#26680;&#24515;&#26550;&#26500;&#24050;&#32463;&#19981;&#20877;&#26159;&#22522;&#20110;PHP&#30340;Wordpress&#31995;&#32479;&#65292;&#32780;&#26159;&#22522;&#20110;Ruby&#30340;Rails&#26694;&#26550;&#12290;&#21516;&#26102;&#26082;&#28982;&#22823;&#25913;&#29256;&#65292; &#23601;&#39034;&#20415;&#25226;&#32593;&#31449;&#30340;&#30028;&#38754;&#25913;&#25104;&#20102;&#25105;&#20010;&#20154;&#30475;&#19978;&#21435;&#25402;&#20859;&#30524;&#30340;Facebook&#26032;&#30028;&#38754;&#12290;&lt;/p&gt;
&lt;p&gt;&#23545;&#20110;&#35835;&#32773;&#32780;&#35328;&#65292;&#26368;&#22823;&#30340;&#25913;&#21464;&#23601;&#26159;&#35780;&#35770;&#21151;&#33021;&#12290;Wordpress&#30340;&#35780;&#35770;&#22823;&#23478;&#24050;&#32463;&#29087;&#30693;&#20102;&#65292;&#20294;&#25105;&#30340;&#21338;&#23458;&#21457;&#34920;&#35780;&#35770;&#30340;&#20154;&#24182;&#19981;&#22810;&#65292;&#20498;&#26159;&#26377;&#19981;&#23569;&#20154;&#22240;&#20026;&#21508;&#31181;&#21407;&#22240;&#65292;&#25214;&#20986;&#25105;&#30340;&#37038;&#31665;&#22320;&#22336;&#65292;&#21457;&#37038;&#20214;&#32473;&#25105;&#12290;&lt;/p&gt;
&lt;p&gt;&#25152;&#20197;&#26032;&#29256;&#30340;&#35780;&#35770;&#21151;&#33021;&#23601;&#32034;&#24615;&#21464;&#25104;&#20102;&#19968;&#20010;&#31616;&#21333;&#30340;&#34920;&#21333;&#65292;&#35835;&#32773;&#21482;&#38656;&#36755;&#20837;&#35201;&#21578;&#35785;&#25105;&#30340;&#20869;&#23481;&#21644;&#33258;&#24049;&#30340;&#37038;&#31665;&#22320;&#22336;&#65292;&#31995;&#32479;&#20250;&#33258;&#21160;&#23558;&#20854;&#21457;&#36865;&#33267;&#25105;&#30340;&#37038;&#31665;&#65292;&#25105;&#25910;&#21040;&#21518;&#23601;&#21487;&#20197;&#30452;&#25509;&#22238;&#22797;&#32473;&#35835;&#32773;&#12290;&lt;/p&gt;
&lt;p&gt;&#20869;&#23481;&#26041;&#38754;&#65292;&#31449;&#20869;&#30340;&#26085;&#24535;&#20998;&#25104;&#20004;&#31867;&#65306;&lt;a href="http://zfben.com/blog" target="_blank"&gt;Blog Post&lt;/a&gt;&#21644;&lt;a href="http://zfben.com/delicious" target="_blank"&gt;Delicious Post&lt;/a&gt;&#12290;&#21069;&#32773;&#26159;&#25105;&#30340;&#21407;&#21019;&#26085;&#24535;&#65292;&#21518;&#32773;&#26159;&#25105;&#36716;&#36733;&#30340;&#22909;&#25991;&#12290;&lt;/p&gt;
&lt;p&gt;&#20026;&#20102;&#26356;&#26377;&#25928;&#30340;&#21033;&#29992;&#31449;&#20869;&#30340;&#20869;&#23481;&#65292;&#25105;&#33258;&#21019;&#20102;&#19968;&#22871;&#33258;&#21160;&#20998;&#26512;&#26085;&#24535;&#24182;&#29983;&#25104;Tag&#30340;&#31995;&#32479;&#65292;&#35813;&#31995;&#32479;&#20250;&#33258;&#21160;&#20998;&#26512;&#26085;&#24535;&#24182;&#23545;&#20854;&#36827;&#34892;&#20998;&#31867;&#65292;&#21516;&#26102;&#29983;&#25104;&#30456;&#20851;&#26085;&#24535;&#12290;&lt;/p&gt;
&lt;p&gt;&#21478;&#22806;&#32593;&#31449;&#39030;&#37096;&#30340;&#25628;&#32034;&#26694;&#20063;&#25402;&#37266;&#30446;&#65292;&#21487;&#20197;&#29992;&#20110;&#31449;&#20869;&#25628;&#32034;&#12290;&lt;/p&gt;
&lt;p&gt;&#30446;&#21069;&#32593;&#31449;&#22788;&#20110;&#35797;&#36816;&#34892;&#29366;&#24577;&#65292;&#19981;&#22826;&#31283;&#23450;&#65292;&#24076;&#26395;&#22823;&#23478;&#21253;&#28085;:)&lt;/p&gt;</description>
      <pubDate>Tue, 02 Mar 2010 08:00:04 GMT</pubDate>
      <guid>http://zfben.com/blog/%E5%AF%82%E9%9D%99%E5%B0%8F%E7%AB%992.0%E7%89%88%E8%AF%95%E8%BF%90%E8%A1%8C</guid>
    </item>
    <item>
      <title>Ubuntu&#19979;nginx&#30340;dev&#28304;</title>
      <link>http://zfben.com/blog/Ubuntu%E4%B8%8Bnginx%E7%9A%84dev%E6%BA%90</link>
      <description>ppa:jdub/devel</description>
      <pubDate>Fri, 12 Feb 2010 08:41:10 GMT</pubDate>
      <guid>http://zfben.com/blog/Ubuntu%E4%B8%8Bnginx%E7%9A%84dev%E6%BA%90</guid>
    </item>
    <item>
      <title>Rails&#20013;&#32473;link_to&#22686;&#21152;class</title>
      <link>http://zfben.com/blog/Rails%E4%B8%AD%E7%BB%99link_to%E5%A2%9E%E5%8A%A0class</link>
      <description>&lt;p&gt;&amp;lt;%= link_to 'example', {:action =&amp;gt; &amp;quot;index&amp;quot;, :id =&amp;gt; @item}, :class =&amp;gt; &amp;quot;myclass&amp;quot; %&amp;gt;&lt;/p&gt;</description>
      <pubDate>Sun, 28 Feb 2010 07:41:57 GMT</pubDate>
      <guid>http://zfben.com/blog/Rails%E4%B8%AD%E7%BB%99link_to%E5%A2%9E%E5%8A%A0class</guid>
    </item>
    <item>
      <title>Ubuntu&#19979;&#23433;&#35013;sphinx</title>
      <link>http://zfben.com/blog/Ubuntu%E4%B8%8B%E5%AE%89%E8%A3%85sphinx</link>
      <description>&lt;p&gt;sudo apt-get install sphinx-search&lt;/p&gt;
&lt;p&gt;&#26631;&#20934;&#23433;&#35013;&#27861;&#65306; sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install build-essential sudo apt-get install libmysqlclient15-dev  tar xvzf sphinx-0.9.8.1.tar.gz cd sphinx-0.9.8.1/ ./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql  make sudo make install&lt;/p&gt;</description>
      <pubDate>Sun, 28 Feb 2010 06:28:00 GMT</pubDate>
      <guid>http://zfben.com/blog/Ubuntu%E4%B8%8B%E5%AE%89%E8%A3%85sphinx</guid>
    </item>
    <item>
      <title>Action Controller:Filters</title>
      <link>http://zfben.com/blog/Action%20Controller:Filters</link>
      <description>&lt;p&gt;before_filter :require_login&lt;/p&gt;
&lt;p&gt;skip_before_filter :require_login, :only =&gt; [:new, :create]&lt;/p&gt;
&lt;p&gt;around_filter :catch_exceptions&lt;/p&gt;
&lt;p&gt;before_filter { |controller| redirect_to new_login_url unless controller.send(:logged_in?) }&lt;/p&gt;
&lt;p&gt;class ApplicationController &lt; ActionController::Base&lt;/p&gt;
&lt;p&gt;  before_filter LoginFilter&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;class LoginFilter&lt;/p&gt;
&lt;p&gt;  def self.filter(controller)&lt;/p&gt;
&lt;p&gt;    unless logged_in?&lt;/p&gt;
&lt;p&gt;      controller.flash[:error] = "You must be logged in to access this section"&lt;/p&gt;
&lt;p&gt;      controller.redirect_to controller.new_login_url&lt;/p&gt;
&lt;p&gt;    end&lt;/p&gt;
&lt;p&gt;  end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;&#21442;&#32771;&#65306;&lt;a href="http://rails.learnhub.com/lesson/6373-action-controller-filters"&gt;http://rails.learnhub.com/lesson/6373-action-controller-filters&lt;/a&gt;&lt;/p&gt;
</description>
      <pubDate>Thu, 11 Feb 2010 04:27:00 GMT</pubDate>
      <guid>http://zfben.com/blog/Action%20Controller:Filters</guid>
    </item>
    <item>
      <title>Virtualbox Ubuntu Guest&#20849;&#20139;&#25968;&#25454;&#31354;&#38388;</title>
      <link>http://zfben.com/blog/Virtualbox%20Ubuntu%20Guest%E5%85%B1%E4%BA%AB%E6%95%B0%E6%8D%AE%E7%A9%BA%E9%97%B4</link>
      <description>sudo mkdir /media/windows-share
sudo mount -t vboxsf folder-name /media/windows-share

You could use the /etc/init.d/rc.local script to execute these commands on startup to have the shared folders automatically mounted every time you start your Ubuntu VirtualBox.</description>
      <pubDate>Sat, 06 Feb 2010 03:47:49 GMT</pubDate>
      <guid>http://zfben.com/blog/Virtualbox%20Ubuntu%20Guest%E5%85%B1%E4%BA%AB%E6%95%B0%E6%8D%AE%E7%A9%BA%E9%97%B4</guid>
    </item>
  </channel>
</rss>
