Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top