Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82056

How to handle non db columns in server side

$
0
0

Hello,

I am using rails and this ajax-datatables-rails gem in the back end.

I am having difficulty with dealing with columns that are not stored in the database. I realize this has as much to do with the gem as it does with datatables but I was hoping someone could give me some thoughts on what the best way to deal with is. Specifically, the present challenge is sorting by the calculated field.

I have a Price model with cost , size attributes and a #cost_per_unit method (cost/size). I want to display and sort cost_per_unit in datatables and I want to sort by cost_per_unit. Does anyone have some ideas on what the best way to deal with this is?


Viewing all articles
Browse latest Browse all 82056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>