How to handle non db columns in server side

How to handle non db columns in server side

gs2589gs2589 Posts: 11Questions: 3Answers: 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?

Answers

  • kthorngrenkthorngren Posts: 21,448Questions: 26Answers: 4,974

    Start by looking at the Orthogonal Data docs. If that doesn't help then please provide a more specific example of what you want to do and the data you are retrieving.

    Kevin

This discussion has been closed.