title: How do you find the namespace/module name programmatically in Ruby on Rails?
body: <p>How do I find the name of the namespace or module 'Foo' in the filter below?</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    def get_module_name
      @module_name = ???
    end
  end
  
  
  class Foo::BarController &lt; ApplicationController
    before_filter :get_module_name
  end
  </code></pre>