title: How can I prevent a page from rendering unless params[:userid] is an Integer?
body: <p>I'm trying to prevent the page from showing unless a <code>params[:userid]</code> is an integer.</p>
  
  <p>I know the code is being called, because its not throwing errors, its not rendering, and I manually told it to render, then not render to check.</p>
  
  <p>Here is what I'm using to try and do it:</p>
  
  <pre><code>render nothing: true unless params[:userid].is_a? Integer
  </code></pre>
  
  <p>And from reading up quickly on Rails, this should work, at least in theory I suppose. The route is setup properly because I checked it and had the page read back the <code>:userid</code>. There are no errors being thrown from the console, but here is the read out when using <code>/account/jonathan/settings</code> as the route:</p>
  
  <blockquote>
    <p>Started GET "/" for 127.0.0.1 at 2015-09-28 23:04:24 -0400
      ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"
    Processing by PagesController#home as HTML
      Rendered pages/home.html.erb within layouts/application (1.1ms)
    Completed 200 OK in 124ms (Views: 117.6ms | ActiveRecord: 0.0ms)</p>
    
    <p>Started GET "/" for 127.0.0.1 at 2015-09-28 23:04:31 -0400
    Processing by PagesController#home as HTML
      Rendered pages/home.html.erb within layouts/application (0.0ms)
    Completed 200 OK in 15ms (Views: 14.9ms | ActiveRecord: 0.0ms)</p>
    
    <p>Started GET "/account/jonathan/settings" for 127.0.0.1 at 2015-09-28 23:04:32 -0400
    Processing by AccountController#settings as HTML
      Parameters: {"userid"=>"jonathan"}
      Rendered text template (0.0ms)
    Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)</p>
    
    <p>Started GET "/account/jonathan/settings" for 127.0.0.1 at 2015-09-28 23:04:38 -0400
    Processing by AccountController#settings as HTML
      Parameters: {"userid"=>"jonathan"}
      Rendered text template (0.0ms)
    Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)</p>
  </blockquote>
  
  <p>And when using <code>/account/1/settings</code> as the route:</p>
  
  <blockquote>
    <p>Started GET "/account/1/settings" for 127.0.0.1 at 2015-09-28 23:27:00 -0400
    Processing by AccountController#settings as HTML
      Parameters: {"userid"=>"1"}
      Rendered text template (0.0ms)
    Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)</p>
    
    <p>Started GET "/account/1/settings" for 127.0.0.1 at 2015-09-28 23:27:00 -0400
    Processing by AccountController#settings as HTML
      Parameters: {"userid"=>"1"}
      Rendered text template (0.0ms)
    Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)</p>
  </blockquote>
  
  <p>I have tried using a route such as <code>/account/1/settings</code> and <code>/account/jon/settings</code> and neither show whats wrong.</p>