title: ActionController::UnknownFormat: New User Index
body: <p>Please could i get some assistance as you all are very helpful!</p>
  
  <p>I am trying to load the index page on a new users sign up. It should load with only requests created by them but as they have not created any yet im getting the error below.</p>
  
  <p>ActionController::UnknownFormat in RequestsController#index
  Started GET "/requests.15" for ::1 at 2019-05-14 13:06:11 +0100
  Processing by RequestsController#index as
    User Load (0.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ?  ORDER BY "users"."id" ASC LIMIT 1  [["id", 15]]
  Completed 406 Not Acceptable in 12ms (ActiveRecord: 0.0ms)</p>
  
  <p>ActionController::UnknownFormat (ActionController::UnknownFormat):
    app/controllers/requests_controller.rb:20:in `index'</p>
  
  <p>Here is my requests index controller</p>
  
  <pre><code>class RequestsController &lt; ApplicationController
  
  
    def index
      if current_user.landlord?
        @requests = Request.where(house: current_user.houses).order("created_at DESC")
        respond_to do |format|
            format.html
            format.pdf do
              pdf = RequestPdf.new(@request)
              send_data pdf.render, filename: "request_report.pdf",
                                    type: "application/pdf",
                                    disposition: "inline"
            end
          end
      elsif current_user.tenant?
        @requests = Request.where(user_id: current_user).order("created_at DESC")
      else
        @requests = Request.search(params[:search]).order("created_at DESC")
        respond_to do |format|
            format.html
            format.pdf do
              pdf = RequestPdf.new(@request)
              send_data pdf.render, filename: "request_report.pdf",
                                    type: "application/pdf",
                                    disposition: "inline"
            end
          end
      end
    end
  </code></pre>
  
  <p>Thank you in advance!</p>