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?

Était-ce utile?

La 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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top