1
In User_profile.rb, User_profile belongs_to :user
.
그러면 users_controller와 해당 index.html.erb가 있습니다. 그래서 이것을 내 사용자 모델에 추가하여 중첩 된 열로 검색 할 수있게했지만 다시 색인하려고하면 오류가 표시됩니다. 이 문제를 어떻게 해결할 수 있습니까? #
에 대한정의되지 않은 메서드`user_profiles '
모델/user.rb
당신은 당신의 user.rb 파일에 사용자has_one :user_profile
을 준
....
searchable do
text :user_profile_nickname do
user_profiles.map { |user_profile| user_profile.nickname }
end
end
....
감사합니다. 이것은 완벽하게 작동합니다! – HUSTEN
안녕하세요. 계속해라. – VenkatK