title: How to redirect to current path without format (.json, .xml -> .html)
body: <p>If I have an unpermitted user trying to request a JSON or CSV file how can I redirect them to the same path but without the format.</p>
  
  <pre><code>  def some_before_filter
      if !current_admin_user.can_download_resources? and request.format != "text/html"
        request.format = "text/html"
      end
    end
  </code></pre>
  
  <p>This directs to the root_path, not the current request without format.</p>
  
  <p>RoR 3.2</p>