<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>活动脚手架 的评论</title>
	<link>http://activescaffold.com.cn</link>
	<description>介绍Ruby on Rails的ActiveScaffold插件，以及用Rails进行企业开发</description>
	<pubDate>Thu, 28 Aug 2008 08:28:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>cab0605 对《ActiveScaffold走向Rails2.0》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/03/12/activescaffold-adopting-rails20/#comment-65</link>
		<dc:creator>cab0605</dc:creator>
		<pubDate>Thu, 21 Aug 2008 09:37:47 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/03/12/activescaffold-adopting-rails20/#comment-65</guid>
		<description>活动脚手架怎么和rolerequirement插件使用,我现在用这个插件不能设置用户的角色.能不能详细说一下.</description>
		<content:encoded><![CDATA[<p>活动脚手架怎么和rolerequirement插件使用,我现在用这个插件不能设置用户的角色.能不能详细说一下.</p>
]]></content:encoded>
	</item>
	<item>
		<title>dil okulu 对《Introduce ActiveScaffold to ShanghaiOnRails (Jan 2008)》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/01/13/introduce-activescaffold-to-shanghaionrails-jan-2008/#comment-64</link>
		<dc:creator>dil okulu</dc:creator>
		<pubDate>Sat, 16 Aug 2008 20:16:07 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/01/13/introduce-activescaffold-to-shanghaionrails-jan-2008/#comment-64</guid>
		<description>great site, but would be better with english support. thanks..</description>
		<content:encoded><![CDATA[<p>great site, but would be better with english support. thanks..</p>
]]></content:encoded>
	</item>
	<item>
		<title>green card 对《ActiveScaffold走向Rails2.0》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/03/12/activescaffold-adopting-rails20/#comment-63</link>
		<dc:creator>green card</dc:creator>
		<pubDate>Fri, 08 Aug 2008 13:58:53 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/03/12/activescaffold-adopting-rails20/#comment-63</guid>
		<description>do you know any information about this in english?</description>
		<content:encoded><![CDATA[<p>do you know any information about this in english?</p>
]]></content:encoded>
	</item>
	<item>
		<title>caoweiyuan 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-61</link>
		<dc:creator>caoweiyuan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 14:54:08 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-61</guid>
		<description>@ashchan 顺着你的提示，我查到了activescaffold项目中的这个issue：http://code.google.com/p/activescaffold/issues/detail?id=553

AS的开发者之一timcharper声明已经在6月18日修好了这个问题。</description>
		<content:encoded><![CDATA[<p>@ashchan 顺着你的提示，我查到了activescaffold项目中的这个issue：http://code.google.com/p/activescaffold/issues/detail?id=553</p>
<p>AS的开发者之一timcharper声明已经在6月18日修好了这个问题。</p>
]]></content:encoded>
	</item>
	<item>
		<title>ashchan 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-60</link>
		<dc:creator>ashchan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 08:53:57 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-60</guid>
		<description>@lele 在FF和Safari下是有可能会出错的，我也遇到过。比方说active_scaffold.js 的第 266 行：
this.adapter.getElementsByClassName('cancel').each(function(elem) {
getElementsByClassName在FF3和Safari里均为内置实现，这一行就会出问题了。</description>
		<content:encoded><![CDATA[<p>@lele 在FF和Safari下是有可能会出错的，我也遇到过。比方说active_scaffold.js 的第 266 行：<br />
this.adapter.getElementsByClassName(&#8217;cancel&#8217;).each(function(elem) {<br />
getElementsByClassName在FF3和Safari里均为内置实现，这一行就会出问题了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>活动脚手架 &#187; 活动脚手架中文论坛开通 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-59</link>
		<dc:creator>活动脚手架 &#187; 活动脚手架中文论坛开通</dc:creator>
		<pubDate>Sun, 29 Jun 2008 04:50:52 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-59</guid>
		<description>[...] 上次发表了不喜欢回答初级问题，也怕宠坏程序员的帖子，有人在javaeye上提出如果单方面拒绝回答初级问题，会显得很狂妄。为此我为那篇文章中的令人不舒服的措辞抱歉。 [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] 上次发表了不喜欢回答初级问题，也怕宠坏程序员的帖子，有人在javaeye上提出如果单方面拒绝回答初级问题，会显得很狂妄。为此我为那篇文章中的令人不舒服的措辞抱歉。 [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>caoweiyuan 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-58</link>
		<dc:creator>caoweiyuan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 04:32:14 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-58</guid>
		<description>@lele 我也听人report过FF下没问题，而IE下报错的。这些问题我都没碰到过，理论上prototype这个js框架提供了跨浏览器支持。你可以看看demo.activescaffold.com.cn是否能运行在不同的浏览器里。如果你确定这是一个bug，可以在google code的各自项目里提交。</description>
		<content:encoded><![CDATA[<p>@lele 我也听人report过FF下没问题，而IE下报错的。这些问题我都没碰到过，理论上prototype这个js框架提供了跨浏览器支持。你可以看看demo.activescaffold.com.cn是否能运行在不同的浏览器里。如果你确定这是一个bug，可以在google code的各自项目里提交。</p>
]]></content:encoded>
	</item>
	<item>
		<title>lele 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-57</link>
		<dc:creator>lele</dc:creator>
		<pubDate>Wed, 25 Jun 2008 10:29:09 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-57</guid>
		<description>我在网站上下载的ActiveScaffold的插件。在IE下可以运行，但是在FF下就报错 报一个RJS的错 说找不到第一行，</description>
		<content:encoded><![CDATA[<p>我在网站上下载的ActiveScaffold的插件。在IE下可以运行，但是在FF下就报错 报一个RJS的错 说找不到第一行，</p>
]]></content:encoded>
	</item>
	<item>
		<title>caoweiyuan 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-56</link>
		<dc:creator>caoweiyuan</dc:creator>
		<pubDate>Wed, 25 Jun 2008 01:44:42 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-56</guid>
		<description>csv export的问题没有经验，抱歉不能彻底帮你解决问题，只能提些想法。在每个model中做重复动作显然不符合DRY原则，你可以自己写一个插件，然后只需要比方说config.csv.columns = :last_name, first_name就可以了。这样的插件也许已经有了，你可以去activescaffold.com的第三方插件wiki页面去看看。</description>
		<content:encoded><![CDATA[<p>csv export的问题没有经验，抱歉不能彻底帮你解决问题，只能提些想法。在每个model中做重复动作显然不符合DRY原则，你可以自己写一个插件，然后只需要比方说config.csv.columns = :last_name, first_name就可以了。这样的插件也许已经有了，你可以去activescaffold.com的第三方插件wiki页面去看看。</p>
]]></content:encoded>
	</item>
	<item>
		<title>dave 对《为什么javaeye上总有人问ActiveScaffold的初级问题？》的评论</title>
		<link>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-55</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Mon, 23 Jun 2008 08:54:44 +0000</pubDate>
		<guid>http://activescaffold.com.cn/blog/2008/06/19/activescaffold-asking-questions/#comment-55</guid>
		<description>我有个业务要求：数据库应用程序经常需要将数据导出为CSV以便打印信息。
参考：http://www.ibm.com/developerworks/cn/linux/l-activescaffold/
在控制器中：
class UsersController  'Export to Excel', :page =&#62; true
  end

  def export_csv
    # find_page is how the List module gets its data. see Actions::List#do_list.
    records = find_page().items
    return if records.size == 0

    # Note this code is very generic.  We could move this method and the
    # action_link configuration into the ApplicationController and reuse it
    # for all our models.
    data = ""
    cls = records[0].class
    data &#60;&#60; cls.csv_header &#60;&#60; "\r\n"
    records.each do &#124;inst&#124;
      data &#60;&#60; inst.to_csv &#60; 'text/csv', :filename =&#62; cls.name.pluralize + '.csv'
  end
end
在model中：
class User &#60; ActiveRecord::Base
  ...

  # The header line lists the attribute names.  ID is quoted to work
  # around an issue with Excel and CSV files that start with "ID".
  def self.csv_header
    ""ID",Last Name,First Name,Email,Birthdate"
  end

  # Emit our attribute values as a line of CSVs
  def to_csv
    id.to_s &#60;&#60; "," &#60;&#60; last_name &#60;&#60; "," &#60;&#60; first_name &#60;&#60; "," &#60;&#60; email &#60;&#60; 
                     "," &#60;&#60; birthdate.to_s
  end
end
因为几乎每个表都要打印，在控制器中直接写到application中就可以了。而在model中要把每个字段都列出来，好像有点麻烦。而且在字段值为空的时候会报错。
有没有什么好的方法？</description>
		<content:encoded><![CDATA[<p>我有个业务要求：数据库应用程序经常需要将数据导出为CSV以便打印信息。<br />
参考：http://www.ibm.com/developerworks/cn/linux/l-activescaffold/<br />
在控制器中：<br />
class UsersController  &#8216;Export to Excel&#8217;, :page =&gt; true<br />
  end</p>
<p>  def export_csv<br />
    # find_page is how the List module gets its data. see Actions::List#do_list.<br />
    records = find_page().items<br />
    return if records.size == 0</p>
<p>    # Note this code is very generic.  We could move this method and the<br />
    # action_link configuration into the ApplicationController and reuse it<br />
    # for all our models.<br />
    data = &#8220;&#8221;<br />
    cls = records[0].class<br />
    data &lt;&lt; cls.csv_header &lt;&lt; &#8220;\r\n&#8221;<br />
    records.each do |inst|<br />
      data &lt;&lt; inst.to_csv &lt; &#8216;text/csv&#8217;, :filename =&gt; cls.name.pluralize + &#8216;.csv&#8217;<br />
  end<br />
end<br />
在model中：<br />
class User &lt; ActiveRecord::Base<br />
  &#8230;</p>
<p>  # The header line lists the attribute names.  ID is quoted to work<br />
  # around an issue with Excel and CSV files that start with &#8220;ID&#8221;.<br />
  def self.csv_header<br />
    &#8220;&#8221;ID&#8221;,Last Name,First Name,Email,Birthdate&#8221;<br />
  end</p>
<p>  # Emit our attribute values as a line of CSVs<br />
  def to_csv<br />
    id.to_s &lt;&lt; &#8220;,&#8221; &lt;&lt; last_name &lt;&lt; &#8220;,&#8221; &lt;&lt; first_name &lt;&lt; &#8220;,&#8221; &lt;&lt; email &lt;&lt;<br />
                     &#8220;,&#8221; &lt;&lt; birthdate.to_s<br />
  end<br />
end<br />
因为几乎每个表都要打印，在控制器中直接写到application中就可以了。而在model中要把每个字段都列出来，好像有点麻烦。而且在字段值为空的时候会报错。<br />
有没有什么好的方法？</p>
]]></content:encoded>
	</item>
</channel>
</rss>
