title: Dynamic Paths in Helper
body: <p>I'm trying to create a helper method for my admin links. In quite a few
  views I have the code</p>
  
  <pre><code>&lt;% if current_user %&gt;
  &lt;%= link_to "Edit", edit_model_path(model) %&gt;
  &lt;%= link_to "New", new_model_path %&gt;
  &lt;%= link_to "Delete", model, :confirm =&gt; "You're a Noob",  :method
  =&gt; :delete %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>that only display these when logged in.</p>
  
  <p>I would like to do something like this in their place</p>
  
  <pre><code>&lt;%= admin_links(model) %&gt;
  </code></pre>
  
  <p>and pass the current item into the application helper method</p>
  
  <pre><code>def admin_links(m)
   if current_user
    a = "#{link_to "edit" edit_m_path(m)}"
    a &lt;&lt; "#{link_to "new" new_m_path}"
    a &lt;&lt; "#{link_to "Delete", m, :confirm =&gt; "Your a Noob",  :method
  =&gt; :delete}"
   end
  end
  </code></pre>
  
  <p>Or something of the like. </p>