我想安裝我的ActiveAdmin
安裝自定義過濾器,它返回一些錯誤。Rails:ActiveAdmin自定義過濾器返回錯誤
用戶模型:
class User < AR::Base
has_many :gpas
def current_gpa
return nil if gpas.blank?
@current_gpa ||= (gpas.where(year: classification).first || gpas.order("updated_at DESC").first)
end
end
ActiveAdmin:
ActiveAdmin.register Athlete do
filter :current_gpa_value, as: :string
end
我得到的錯誤是: ActionView::Template::Error (undefined method current_gpa_value_contains for #<MetaSearch::Searches::User:0x007f982df8fd28>)