The following piece of code can be used in an __.rhtml__ file to automatically generate a sitemap of all the \ActionControllers and their respective actions. Thanks to everyone on IRC's #rubyonrails for helping with this.

<pre>
<code>
<ul>
<%	
    @classes = Hash.new;
    ObjectSpace.each_object(ActionController::Base) { |obj|  
        @classes["#{obj.class}"] = obj
    }
	
    @classes.each_value { |c|
        @cname = c.controller_name
%>
    <li><%= link_to "#{@cname}",  { :action => "index", :controller => "#{@cname}" } %></li>
    <ul style="font-size:1em">
<%	
        @methods = c.class.instance_methods(false)		
        @methods.sort.each { |m| 
            @mname = m.to_s
            next if @mname == "index"
%>
        <li><%=link_to "#{@mname}", { :action => "#{@mname}", :controller => "#{@cname}" } %></li>
<%		
        }
%>
    </li></ul>
<% 
    } 
%>
</ul>
</code>
</pre>


*Comments*
This is rather handy but I think it needs to be tidied up somewhat. That's far too much code to be sticking into an rhtml file in my opinion. I think this could be tidied away into a helper or something. - Goynang

LeeO: The above code apparently doesn't work any more (having to do with how files are loaded in more recent versions of Rails). On [[IRC]] Ulysses suggested preceeding the @ObjectSpace@ loop with some code to load all the controlles, so they can be found:
<pre><code>require 'find'
Find.find(File.join(RAILS_ROOT, 'app/controllers'))  { |name| 
  require_dependency(name) if /_controller\.rb$/ =~ name
}</code></pre>

Phrogz: Related is DiscoveringControllersAndActions, detailing a way to create a list of all "controller/action" strings, for use in ACL security.
