title: How to change a route name rails 4
body: <p>I changed the routing of <code>posts#index</code> to match <code>blog</code> and I now get <code>/blog</code> in the URL which I was trying to accomplish. </p>
  
  <p>I've tried several different things to get my actual blog post which the route currently looks something like <code>/posts/this-is-a-test</code> to also use <code>blog</code> rather than <code>posts</code> in the URL.<br>
  Below is my current <strong>route</strong> file. I am using the <code>friendly_id</code> gem, if that makes any difference in answering this question. </p>
  
  <pre><code>resources :posts do
    resources :comments
  end
  
    resources :contacts, only: [:new, :create]
  
    root "pages#home"
  
    get "/home", to: "pages#home", as: "home"
    get "about" =&gt; 'pages#about'
    get "pricing" =&gt; 'pages#pricing'
    get "contact_us" =&gt; 'pages#contact_us'
    match 'blog', to: 'posts#index', via: :all
  end 
  </code></pre>