Take a look a this line ```respond_to :html, :json```  I add the :json format to respond.