SQLite3::SQLException: near "at": 语法错误

SQLite3::SQLException: near "at": syntax error

我在尝试遍历我的作业时不断收到此错误,这是代码:

- @jobs.each do |job|
  %h2= job.title
  %p= job.company 

此异常:“SQLite3::SQLException:靠近“at”:语法错误”它没有识别行开头的“-”。我的文件是一个 .html.haml 文件。

这是作业控制器:

class JobsController < ApplicationController
    before_action :find_job, only: [:show, :edit , :update , :destroy]

    def index
        @jobs=Job.all.order("created at DESC")
    end 

    def show 
    end

    def new
        @job=Job.new 
    end

    def create 
        @job=Job.new[job_params]
        if(@job.save)
            redirect_to @job
        else 
            render "New"
        end 
    end

    def edit
    end 

    def update
    end

    def destroy
    end

    def job_params
        params.require(:job).permit(:title , :description , :company , :url)
    end

    def find_job
        @job=Job.find(params[:id])
    end

end

还有application_job

class ApplicationJob < ActiveJob::Base
  # Automatically retry jobs that encountered a deadlock
  # retry_on ActiveRecord::Deadlocked

  # Most jobs are safe to ignore if the underlying records are no longer available
  # discard_on ActiveJob::DeserializationError
end

您的订单查询有错字:order("created at DESC") 应该是 order("created_at DESC")