<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>zzjkevin (kevin)</title>
    <link>https://ruby-china.org/zzjkevin</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>求一个推荐算法</title>
      <description>&lt;p&gt;求一个推荐算法，举个例子，不知道恰当不恰当，例如我想搜索 ruby 的问题，算法可以推荐一些博客，或者是 ruby 社区可以找到，又或者例如我想下载某个资料，可以推荐一些地方让我去搜索。。&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Fri, 18 Apr 2014 19:27:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/18696</link>
      <guid>https://ruby-china.org/topics/18696</guid>
    </item>
    <item>
      <title>求一个相识度算法。</title>
      <description>&lt;p&gt;例如我的站点里面有两篇相识度非常高，甚至是 copy 的文章，我想利用去检测他们的相识度，然后归类起来。有没有什么较好的相识度检测算法？谢谢！&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Wed, 16 Apr 2014 19:10:32 +0800</pubDate>
      <link>https://ruby-china.org/topics/18645</link>
      <guid>https://ruby-china.org/topics/18645</guid>
    </item>
    <item>
      <title>rails 实现站内信的插件</title>
      <description>&lt;p&gt;记得之前看过有一个专门的插件用于实现 ruby on rails 站内信的，忘记了，有哪位高手可以告诉小弟是那个已经使用例子，学习学习，感激不尽。&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Wed, 02 Apr 2014 11:11:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/18335</link>
      <guid>https://ruby-china.org/topics/18335</guid>
    </item>
    <item>
      <title>使用 action mailer 报错。</title>
      <description>&lt;p&gt;class UserMailer &amp;lt; ActionMailer::Base
  default from: "&lt;a href="/126.com" class="user-mention" title="@126.com"&gt;&lt;i&gt;@&lt;/i&gt;126.com&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;def send_mail(params = {})&lt;br&gt;
    &lt;a href="/url" class="user-mention" title="@url"&gt;&lt;i&gt;@&lt;/i&gt;url&lt;/a&gt;  = '&lt;a href="http://example.com/login" rel="nofollow" target="_blank"&gt;http://example.com/login&lt;/a&gt;'&lt;br&gt;
    mail( :subject =&amp;gt; 'abcAAAAAAAASDFADSFADSFADSFDASFASDF',&lt;br&gt;
          :to =&amp;gt; "&lt;a href="/qq.com" class="user-mention" title="@qq.com"&gt;&lt;i&gt;@&lt;/i&gt;qq.com&lt;/a&gt;",&lt;br&gt;
          :from =&amp;gt; '&lt;a href="/126.com" class="user-mention" title="@126.com"&gt;&lt;i&gt;@&lt;/i&gt;126.com&lt;/a&gt;',&lt;br&gt;
          :date =&amp;gt; Time.now&lt;br&gt;
        )&lt;br&gt;
  end&lt;br&gt;
end&lt;/p&gt;

&lt;p&gt;定义了一个方法，然后在我的一个控制器里面，UserMailer.send_mail(nil).deliver 发邮件。&lt;/p&gt;

&lt;p&gt;environment.rb 里面的配置如下：&lt;/p&gt;

&lt;p&gt;config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
  address:              'smtp.126.com',
  port:                 25,
  domain:               '126.com',
  user_name:            'xxxx@126.com',
  password:             'xxxxx',
  authentication:       'login',
  enable_starttls_auto: true  }&lt;/p&gt;

&lt;p&gt;但是最后，会报错：
Missing template user_mailer/send_mail with "mailer". Searched in: * "user_mailer"&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Tue, 01 Apr 2014 19:42:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/18322</link>
      <guid>https://ruby-china.org/topics/18322</guid>
    </item>
    <item>
      <title>github 版本恢复问题 (新手)</title>
      <description>&lt;p&gt;第一次使用 github，刚学习了如何推送和下载。。就是如果我通过新建分支推送几次了，现在想恢复原先的版本，或者我想下载之前几次的版本，怎么弄呢？&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Mon, 31 Mar 2014 20:37:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/18291</link>
      <guid>https://ruby-china.org/topics/18291</guid>
    </item>
    <item>
      <title>基于 ruby on rails 做一个站内搜索 (不基于谷歌百度的站内搜索)</title>
      <description>&lt;p&gt;就是做一个简单的基于关键词的站内搜索，想自己写的话，有没有什么可以参考学习学习的？&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Thu, 27 Mar 2014 16:06:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/18210</link>
      <guid>https://ruby-china.org/topics/18210</guid>
    </item>
    <item>
      <title>实现用户给一个特定的邮箱发邮件 (建议意见等)。</title>
      <description>&lt;p&gt;例如网站有个建议和推荐的功能，用户编辑之后，点击发送按钮，可以发送到一个指定的邮箱里面，请问这个怎么通过 ruby on rails 去实现？有什么 gem 插件可以使用吗？&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Wed, 26 Mar 2014 19:42:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/18191</link>
      <guid>https://ruby-china.org/topics/18191</guid>
    </item>
    <item>
      <title>基于 AJAX 的按钮实现。</title>
      <description>&lt;p&gt;有两个表单：
&amp;lt;%= form_for(&lt;a href="/web" class="user-mention" title="@web"&gt;&lt;i&gt;@&lt;/i&gt;web&lt;/a&gt; ,remote: true) do |f| %&amp;gt;
      &amp;lt;%= f.submit "Follow", class: "btn btn-large btn-primary" %&amp;gt;
      &amp;lt;% end %&amp;gt; &lt;/p&gt;

&lt;p&gt;&amp;lt;%= form_for(&lt;a href="/web" class="user-mention" title="@web"&gt;&lt;i&gt;@&lt;/i&gt;web&lt;/a&gt;, html: { method: :delete },remote: true) do |f| %&amp;gt;
      &amp;lt;%= f.submit "Unfollow", class: "btn btn-large btn-primary" %&amp;gt;
      &amp;lt;% end %&amp;gt; &lt;/p&gt;

&lt;p&gt;我是用 ajax 的方式，想实现，例如原来是 follow 的，点击完之后变成 unfollow，原来是 unfollow，点击完之后是 follow。&lt;/p&gt;

&lt;p&gt;我的控制器里面是：
respond_to do |format|
        format.html { redirect_to home_path }
        format.js
end&lt;/p&gt;

&lt;p&gt;还需要 JS 的代码怎么写？或者是我这里有没有什么不当的地方？&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Wed, 19 Mar 2014 23:05:57 +0800</pubDate>
      <link>https://ruby-china.org/topics/18022</link>
      <guid>https://ruby-china.org/topics/18022</guid>
    </item>
    <item>
      <title>我想通过一个表单，传输一个参数到控制器。</title>
      <description>&lt;p&gt;新手求教：
我的主页如下显示：这里是显示所有的 website 变量，每一个变量后面有一个对应的按钮，然后希望通过一个按钮，把当前 website 的 id，传到 website 控制器。&lt;/p&gt;

&lt;p&gt;&amp;lt;% &lt;a href="/websites.each" class="user-mention" title="@websites.each"&gt;&lt;i&gt;@&lt;/i&gt;websites.each&lt;/a&gt; do |website| %&amp;gt;
      &lt;/p&gt;
      &amp;lt;%= website.id %&amp;gt; &amp;lt;%= website.name %&amp;gt; &amp;lt;%= website.brief %&amp;gt;
           &amp;lt;%= form_for(&lt;a href="/web" class="user-mention" title="@web"&gt;&lt;i&gt;@&lt;/i&gt;web&lt;/a&gt;) do |f| %&amp;gt;
          &amp;lt;%= f.submit "Follow", class: "btn btn-large btn-primary" %&amp;gt;
      
&amp;lt;%end%&amp;gt;

&lt;p&gt;主页控制器是：&lt;a href="/website" class="user-mention" title="@website"&gt;&lt;i&gt;@&lt;/i&gt;website&lt;/a&gt; = Website.all，同时我定义哥一&lt;a href="/web" class="user-mention" title="@web"&gt;&lt;i&gt;@&lt;/i&gt;web&lt;/a&gt; = Website.new&lt;/p&gt;

&lt;p&gt;我的 website 控制器是：&lt;a href="/web" class="user-mention" title="@web"&gt;&lt;i&gt;@&lt;/i&gt;web&lt;/a&gt; = Website.new(params[:web])，但是这个&lt;a href="/web.id" class="user-mention" title="@web.id"&gt;&lt;i&gt;@&lt;/i&gt;web.id&lt;/a&gt;始终是空的，这个到底怎么把我想要的变量传过来？&lt;/p&gt;</description>
      <author>zzjkevin</author>
      <pubDate>Wed, 19 Mar 2014 16:24:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/18007</link>
      <guid>https://ruby-china.org/topics/18007</guid>
    </item>
  </channel>
</rss>
