ruby on rails

I'm building some kind of a grading system for practice. In rails_admin.rb I have:

config.model Student do
    object_label_method do
      :student_code
    end
end

config.model Grade do
    list do
      field :student do
        searchable :student_code
      end
      field :course
      field :category
      field :score
    end
end

Using rails_admin gives me a Student filter automatically, however, it searches based on the student_id. How do I customize the Student filter in Grades admin view to search students based on its student_code attribute? Using searchable like the docs suggested doesn't give any results.

链接地址: http://www.djcxy.com/p/67058.html

上一篇: 尊重与铁路的关联

下一篇: 红宝石在轨道上