页面加载但控制器中未初始化的常量

时间:2016-01-04 13:19:01

标签: ruby ruby-on-rails-4 runtime-error rails-routing

好的我有这门课;页面加载和一切。

class HumanResources::AttendancePerformance::AttendancesController < HumanResources::AttendancePerformanceController

  def index
    query = generic_table_aggregated_queries('attendances','attendances.created_at')
    begin
      @attendances = Attendance
                         .includes(employee: [:actor])
                         .joins(employee: [:actor])
                         .where("actors.name LIKE ? OR " +
                                    "attendances.id LIKE ? OR " +
                                    "attendances.timein LIKE ? OR " +
                                    "attendances.timeout LIKE ? OR " +
                                    "attendances.remark LIKE ? OR " +
                                    "attendances.updated_at LIKE ? OR " +
                                    "attendances.created_at LIKE ?",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%",
                                "%#{query[:search_field]}%")
                         .order(query[:order_parameter] + ' ' + query[:order_orientation])
      @attendances = Kaminari.paginate_array(@attendances).page(params[:page]).per(query[:current_limit])
    rescue => ex
      flash[:general_flash_notification] = "Error has Occured" + ex.to_s
    end
    render 'human_resources/attendance_performance/attendances/index'
  end
是的,我知道它有点长;只是为了确保我没有错过任何一切,我确定错误在这里,但我找不到。页面加载。我只是不知道在哪里以及为什么这么说

uninitialized constant HumanResources::AttendancePerformance::AttendancesController::Attendance

我认为它是“出勤”模式,但它之前一直有效......错误在哪里?它是否与模型的命名和控制器类似有关?

0 个答案:

没有答案