title: Rails / Friendly_id. How to render 404 pages for old (ugly) URLs
body: <p>I have installed the <code>friendly_id</code> gem for a new rails application in order to create pretty URLs for user profiles. And everything works fine, but I would like the old (ugly) URLs to return 404 pages, as it should be normal. At this point a user profile is available through both these URLs:</p>
  
  <ul>
  <li>ugly (old) URL: /profile/11</li>
  <li>pretty URL: /profile/jon-smith</li>
  </ul>
  
  <p>The routes rule I'm using:</p>
  
  <pre><code>get 'profile/:id', to: 'users#show', as: 'user'
  </code></pre>
  
  <p>User controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
      def show
          @user = User.friendly.find(params[:id])
      end
  end
  </code></pre>
  
  <p>And strangely I couldn't find anything online that could help me with this issue, so any ideas on this ?</p>