<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>yuan_yp</title>
    <link>https://ruby-china.org/yuan_yp</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>rails 项目中怎么实现批量打印</title>
      <description>&lt;p&gt;如题&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Wed, 11 Sep 2013 09:07:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/14022</link>
      <guid>https://ruby-china.org/topics/14022</guid>
    </item>
    <item>
      <title>有什么插件，或者 word 里面的宏能将 word 转换成 pdf 的</title>
      <description>&lt;p&gt;如题&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Tue, 27 Aug 2013 10:21:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/13659</link>
      <guid>https://ruby-china.org/topics/13659</guid>
    </item>
    <item>
      <title>form_for 的提交路由修改</title>
      <description>&lt;pre class="highlight erb"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;form_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@product&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
  &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vi"&gt;@product.errors.any&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"error_explanation"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;pluralize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vi"&gt;@product.errors.count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt; prohibited this product from being saved:&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="vi"&gt;@product.errors.full_messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;&amp;lt;%=&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
 &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;上面的代码的 form 路径怎么修改&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Thu, 22 Aug 2013 14:43:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/13519</link>
      <guid>https://ruby-china.org/topics/13519</guid>
    </item>
    <item>
      <title>代码报错,什么原因</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="vi"&gt;@userrole&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Userrole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'userID=?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="vi"&gt;@user.id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="vi"&gt;@userrole.each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;userrole&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
          &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;userrole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;roleID&lt;/span&gt;
          &lt;span class="vi"&gt;@role&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id=?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;userrole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;roleID&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="vi"&gt;@cfunction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;AuthCf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'authID=?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="vi"&gt;@role.authorityID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="vi"&gt;@cfunction.each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;cfunction&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
            &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;cfunction&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CFID&lt;/span&gt;
            &lt;span class="vi"&gt;@function&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;CFf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'cFID=?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;cfunction&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CFID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
           &lt;span class="vi"&gt;@funciton.each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
              &lt;span class="vi"&gt;@f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'id=?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fID&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
              &lt;span class="vi"&gt;@arr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="vi"&gt;@f.name&lt;/span&gt;
            &lt;span class="k"&gt;end&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;&lt;code&gt;@funciton.each do|function|&lt;/code&gt;
报错
undefined method ''each' for nil:NilClass&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Fri, 16 Aug 2013 08:38:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/13366</link>
      <guid>https://ruby-china.org/topics/13366</guid>
    </item>
    <item>
      <title>有没有关于自定义审核流程的 gem 包，名字叫什么</title>
      <description>&lt;p&gt;问题如上&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Tue, 06 Aug 2013 15:07:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/13101</link>
      <guid>https://ruby-china.org/topics/13101</guid>
    </item>
    <item>
      <title>关于正则验证</title>
      <description>&lt;p&gt;需要验证中文，/^[u4e00-u9fa5]{1,10}$/这个正则表达式对吗，为什么没用&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Mon, 22 Jul 2013 10:31:26 +0800</pubDate>
      <link>https://ruby-china.org/topics/12663</link>
      <guid>https://ruby-china.org/topics/12663</guid>
    </item>
    <item>
      <title>Rails 3 中怎么建立外键</title>
      <description>&lt;p&gt;我在数据库中手动建立外键好像没用，belong_to 和 has_many 都写了，但是前台遍历完之后 user.organization.orgName 出不来&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Tue, 09 Jul 2013 09:31:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/12365</link>
      <guid>https://ruby-china.org/topics/12365</guid>
    </item>
    <item>
      <title>关于 belong_to 的问题</title>
      <description>&lt;p&gt;我在后台有两个 model，一个 user，一个 organization，user belong_to organization，那我在前台页面对 user 对象数组进行遍历的时候怎么取到 organization 里面的字段值，是直接 user.organName 还是 user.organization.organName。organName 是 organization 里面的字段。&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Mon, 08 Jul 2013 13:44:51 +0800</pubDate>
      <link>https://ruby-china.org/topics/12339</link>
      <guid>https://ruby-china.org/topics/12339</guid>
    </item>
    <item>
      <title>关于 Rails 路由</title>
      <description>&lt;p&gt;我的前台请求路径&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;url ："/organization/organPassShow"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;我的 organization 控制层代码&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;organPassShow&lt;/span&gt;&lt;span class="c1"&gt;#在管理员页面显示组织信息列表，跳转到已审核组织信息列表&lt;/span&gt;
    &lt;span class="no"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'+++++++++++++++++++++'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"---------------------------"&lt;/span&gt;
    &lt;span class="vi"&gt;@organs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Organization&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"isState=?"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="vi"&gt;@organs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;orgName&lt;/span&gt;
    &lt;span class="n"&gt;respond_to&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
      &lt;span class="nb"&gt;format&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;html&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;问题请求没进来
控制台没打印&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Fri, 05 Jul 2013 13:36:35 +0800</pubDate>
      <link>https://ruby-china.org/topics/12270</link>
      <guid>https://ruby-china.org/topics/12270</guid>
    </item>
    <item>
      <title>关于对象封装</title>
      <description>&lt;p&gt;各位，如果我有两个 model，一个 user，一个 organ，但是我需要封装成一个对象，这个对象有&lt;a href="/user.name" class="user-mention" title="@user.name"&gt;&lt;i&gt;@&lt;/i&gt;user.name&lt;/a&gt;和 organ.name，我该怎么弄&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Thu, 04 Jul 2013 16:02:14 +0800</pubDate>
      <link>https://ruby-china.org/topics/12245</link>
      <guid>https://ruby-china.org/topics/12245</guid>
    </item>
    <item>
      <title>Rails 3 中 model 层怎么获取 session 里面的值</title>
      <description>&lt;p&gt;如标题描述&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Thu, 04 Jul 2013 09:47:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/12234</link>
      <guid>https://ruby-china.org/topics/12234</guid>
    </item>
    <item>
      <title>删除使用 @user.destory 还是 @user.delete</title>
      <description>&lt;p&gt;删除数据库操作用哪个，有什么区别&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Wed, 03 Jul 2013 09:23:40 +0800</pubDate>
      <link>https://ruby-china.org/topics/12204</link>
      <guid>https://ruby-china.org/topics/12204</guid>
    </item>
    <item>
      <title>关于 Rails update 的问题</title>
      <description>&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/4463ba141f4ddc4f1b27894de898add7.png" title="" alt=""&gt;
我要修改我的密码是 123456，更新的代码应该怎么写&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Tue, 02 Jul 2013 23:15:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/12201</link>
      <guid>https://ruby-china.org/topics/12201</guid>
    </item>
    <item>
      <title>关于 Rails 中引用样式的问题</title>
      <description>&lt;p&gt;------这是 rails 中的样式----------
&lt;img src="//l.ruby-china.com/photo/3ab9f638d2639652b8bbcf046671b034.jpg" title="" alt=""&gt;
------这是正常的样式-----------
&lt;img src="//l.ruby-china.com/photo/e5b44b75d1d0128e9187af148572a926.jpg" title="" alt=""&gt;
--------问题---------
为什么我将今天页面放到 rails 中吧 html 改成 html.erb 会出现这种情况。&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Tue, 02 Jul 2013 10:13:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/12167</link>
      <guid>https://ruby-china.org/topics/12167</guid>
    </item>
    <item>
      <title>数据库是 string 类型，传入的值也是 string 类型，报输入类型不符怎么回事</title>
      <description>&lt;p&gt;----报错-----
Organ(#28225248) expected, got String(#14152944)
-----model 层------
  def regist(username,password,organ) 
      &lt;a href="/user" class="user-mention" title="@user"&gt;&lt;i&gt;@&lt;/i&gt;user&lt;/a&gt; = User.new
      &lt;a href="/user.username" class="user-mention" title="@user.username"&gt;&lt;i&gt;@&lt;/i&gt;user.username&lt;/a&gt; = username
      &lt;a href="/user.password" class="user-mention" title="@user.password"&gt;&lt;i&gt;@&lt;/i&gt;user.password&lt;/a&gt; = password
      puts "---------1"
      &lt;a href="/user.organ" class="user-mention" title="@user.organ"&gt;&lt;i&gt;@&lt;/i&gt;user.organ&lt;/a&gt; = organ
      puts "---------2"
      &lt;a href="/user.save" class="user-mention" title="@user.save"&gt;&lt;i&gt;@&lt;/i&gt;user.save&lt;/a&gt;
  end
--------数据库---------&lt;img src="//l.ruby-china.com/photo/6b441b16a606cafb5284602c0c56fa13.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Mon, 01 Jul 2013 21:45:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/12157</link>
      <guid>https://ruby-china.org/topics/12157</guid>
    </item>
    <item>
      <title>Rail 中 responce_to 什么意思</title>
      <description>&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/45b5453b396e3e244184af5486fb784e.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Sat, 29 Jun 2013 11:22:49 +0800</pubDate>
      <link>https://ruby-china.org/topics/12086</link>
      <guid>https://ruby-china.org/topics/12086</guid>
    </item>
    <item>
      <title>rails 中 select 的使用</title>
      <description>&lt;p&gt;怎么在 view 层页面使用 select，怎么用，最好有案例代码&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Sat, 29 Jun 2013 11:19:24 +0800</pubDate>
      <link>https://ruby-china.org/topics/12085</link>
      <guid>https://ruby-china.org/topics/12085</guid>
    </item>
    <item>
      <title>roo 实现动态读取 Excel 怎么实现</title>
      <description>&lt;p&gt;如图这是我用 roo 读取 excel 的程序&lt;img src="//l.ruby-china.com/photo/4632547e7940bf6dd31031debb297eb0.png" title="" alt=""&gt;
但是对应死了，动态读取应该怎么用&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Thu, 13 Jun 2013 10:59:27 +0800</pubDate>
      <link>https://ruby-china.org/topics/11684</link>
      <guid>https://ruby-china.org/topics/11684</guid>
    </item>
    <item>
      <title>Rails 开发的项目要实现 Excel 表格在页面的显示</title>
      <description>&lt;p&gt;如题，形式类似如图，请各位给个思路&lt;img src="//l.ruby-china.com/photo/e5fa5933a772575adfa3df74669dd747.png" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>yuan_yp</author>
      <pubDate>Thu, 13 Jun 2013 10:19:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/11683</link>
      <guid>https://ruby-china.org/topics/11683</guid>
    </item>
  </channel>
</rss>
