title: rails missing template from link_to and send_file
body: <p>I am trying to display the contents of a Log file, a txt file in html.
  I get 'Template missing error'.</p>
  
  <pre><code>Missing template application/index with {:locale=&gt;[:en], :formats=&gt;[:html], :handlers=&gt;[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}. Searched in: * "/home/Documents/workspace/demo2/app/views"
  </code></pre>
  
  <p>In my controller I have</p>
  
  <pre><code> class ApplicationController &lt; ActionController::Base
    def index
    end
    def displaycontents
    send_file "/home/Documents/workspace/demo.txt", 
            :type =&gt; "text/html", 
            :disposition =&gt; 'inline'
    end
   end
  </code></pre>
  
  <p>In my routes.rb I have</p>
  
  <pre><code>root 'application#index'
  </code></pre>
  
  <p>In my index.html.erb I have</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;new view&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;%= link_to "Log File", :controller=&gt; :application,
      :action=&gt;:displaycontents %&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have kept the index action in the controller file empty so the index.html.erb is rendered by default.</p>
  
  <p>I have restarted the rails server as suggested by another solution.
  And the index.html.erb file is present in demo2/app/views .</p>
  
  <p>The different verions I have used are
  - RUBYGEMS VERSION: 1.8.23
    - RUBY VERSION: 1.9.3 
  -Rails : 4.0.2</p>