ruby on rails - Date filter not displaying -


i created new datetime row page, works well. column displays specific dates, when want show specific rows using date filter, doesn't display thing.

in model:

 before_validation :payment_date   def payment_date   self.payment_date = sales_order.payment_transactions.last.date  end 

the date filter controller file:

   filter :payment_date, :as => :date_range, :collection => proc { complaint.all.map{|c| c.sales_order.try(:payment_transactions).try(:last).try(:date)} } 

i suppose did couple of mistakes , i'm curious bad coding is.

in aa filtering based on ransack, filter follows (assuming sales_order association on model):

filter :sales_order_payment_transactions_date, label: 'some label', as: :date_range 

here go along association chain - acceptable ransack.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -