ruby on rails - Using a ransack filter to adjust join conditions -
ruby on rails - Using a ransack filter to adjust join conditions -
consider model:
merchant: id: int name: string purchase: id: int merchant_id: int created_at: datetime transactions: id: int purchase_id: int amount: decimal
then, i've got activeadmin resource set merchants, on index page custom column displays sum of transaction amounts orders of merchant.
what want date selector on index page (probably in filter section) allows me select date in past after want summed amounts calculated. (i.e. if select oct 1 2014, want transactions summed belong orders created date on).
so, bring together conditions merchant purchases should configurable.
i know how write query in rails , activerecord, have no thought how using ransack activeadmin.
ruby-on-rails activeadmin ransack
Comments
Post a Comment