문제

My filter

filter :club_id, :label => 'Club',
         :as => :select,
         :collection => Hash[Club.order(:city_id).includes(:city).map{|d| ["#{d.city.title}, #{d.address} - #{d.title}",d.id]}]

When I delete or create a club, the drop-down list of select in fiter still does not change. Apparently it is cached. This occurs only in the filters. How do I disable this cache?

도움이 되었습니까?

해결책

Try

 filter :club_id, as: :select, collection: proc { Hash[Club.order(:city_id).includes(:city).map{|d| ["#{d.city.title}, #{d.address} - #{d.title}",d.id]}]}

HTH

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top