title: How to get the name of the current controller into my helper function?
body: <p>I am still new to Rails and I have the following <code>section_links</code> that serve as the main navigation for my Rails app:</p>
  
  <pre><code>&lt;%= section_link(Organisation.model_name.human(:count =&gt; 2), 'organisations', organisations_path) %&gt;
  &lt;%= section_link(Person.model_name.human(:count =&gt; 2), 'people', people_path) %&gt;
  &lt;%= section_link(Project.model_name.human(:count =&gt; 2), 'projects', projects_path) %&gt;           
  &lt;%= section_link(Invoice.model_name.human(:count =&gt; 2), 'invoices', invoices_path) %&gt;       
  &lt;%= section_link(Payment.model_name.human(:count =&gt; 2), 'payments', payments_path) %&gt;
  </code></pre>
  
  <p>I also wrote this very basic helper function:</p>
  
  <pre><code>def section_link(title, section, path)
    options = {}  
    options[:class] = 'current' if section == controller_name
    link_to title, path, options
  end
  </code></pre>
  
  <p>Is there any way to DRY up this helper function, so I can say something like this to make a link: </p>
  
  <p><code>&lt;%= section_link("Organisations") %&gt;</code></p>
  
  <p>I've been trying this for a couple of hours but I don't know how to pass the name of the current controller into my helper function.</p>
  
  <p>Thanks for any help with this...</p>