title: RoR - index method in controller
body: <p>I'm getting this error for the URL <a href="http://localhost:3000/dashboard/" rel="nofollow">http://localhost:3000/dashboard/</a></p>
  
  <p><code>Routing Error No route matches "/dashboard"</code></p>
  
  <p>but <a href="http://localhost:3000/dashboard/index" rel="nofollow">http://localhost:3000/dashboard/index</a> works correct</p>
  
  <p>How can i make all the below URLs works and shows the same view <code>views/dashboard/index.html.erb</code></p>
  
  <pre><code>http://localhost:3000
  http://localhost:3000/
  http://localhost:3000/dashboard
  http://localhost:3000/dashboard/
  http://localhost:3000/dashboard/index
  </code></pre>
  
  <p>My routes file is </p>
  
  <pre><code>Mytest::Application.routes.draw do
    get "dashboard/index"
    root :to =&gt; "dashboard#index"
  end
  </code></pre>
  
  <p>My controller file is </p>
  
  <pre><code>class DashboardController &lt; ApplicationController
    def index
  
    end
  
  end
  </code></pre>