<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 获取所有Controller和Action</title>
	<atom:link href="http://www.letrails.cn/archives/get-all-controller-and-action-names-in-rails-app/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.letrails.cn/archives/get-all-controller-and-action-names-in-rails-app/</link>
	<description></description>
	<lastBuildDate>Mon, 02 Jan 2012 01:59:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: galeki</title>
		<link>http://www.letrails.cn/archives/get-all-controller-and-action-names-in-rails-app/comment-page-1/#comment-285</link>
		<dc:creator>galeki</dc:creator>
		<pubDate>Thu, 24 Apr 2008 11:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.letrails.cn/archives/get-all-controller-and-action-names-in-rails-app#comment-285</guid>
		<description>精简一下 :)

def require_all_controllers(path)
  Dir.foreach(path) do &#124;e&#124;
    next if e =~  /^\./
    controller_path = File.join(path, e)
    if File.directory?(controller_path)
	require_all_controllers(controller_path)
    elsif e =~ /controller.rb$/
        ApplicationController.require_or_load controller_path
    end
  end
end</description>
		<content:encoded><![CDATA[<p>精简一下 <img src='http://www.letrails.cn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>def require_all_controllers(path)<br />
  Dir.foreach(path) do |e|<br />
    next if e =~  /^\./<br />
    controller_path = File.join(path, e)<br />
    if File.directory?(controller_path)<br />
	require_all_controllers(controller_path)<br />
    elsif e =~ /controller.rb$/<br />
        ApplicationController.require_or_load controller_path<br />
    end<br />
  end<br />
end</p>
]]></content:encoded>
	</item>
</channel>
</rss>

