title: Devise how to access resource/resource_name in views
body: <p>I am using devise in my rails application and I have two different resource types, like users and companies.</p>
  
  <p>I would like to reuse some code in views, so inspite of writing </p>
  
  <pre><code>if user_logged_in?
     current_user.name 
  else  
     current_company.name
  </code></pre>
  
  <p>I would like to do this the way devise does:</p>
  
  <pre><code>resource.name
  </code></pre>
  
  <p>Is this possible?</p>