Closed ausangshukla closed 3 months ago
Data table works great, but the json response I recieve back has all numbers converted to strings
{ id: "19", commitment_type: "Pool", folio_id: "<a href="/capital_commitments/19">51694724</a>", unit_type: "Series C", investor_name: "<a href="/investors/28">Waterfield Advisors</a>", full_name: "", fund_name: "<a href="/funds/4">Macro Fund</a>", committed_amount: "1700000.0", collected_amount: "₹0.00", call_amount: "₹13,60,000.00", distribution_amount: "₹7,00,000.00", percentage: "20.0", onboarding_completed: "<span class="badge bg-warning"> No </span>", document_names: "", dt_actions: "<a class="btn btn-outline-primary" href="/capital_commitments/19">Show</a><a class="btn btn-outline-success" href="/capital_commitments/19/edit">Edit</a>", DT_RowId: "capital_commitment_19" },
How can I get back the same json but with numbers without quotes ? Note the default json.jbuilder template returns numbers as numbers.
To be more specific, Id like the id above which is returned as id: "19", to be returned as id: 19 without the double quotes. Any help is appreciated.
Regards
https://github.com/jbox-web/ajax-datatables-rails/issues/269#issuecomment-387940478
Data table works great, but the json response I recieve back has all numbers converted to strings
{ id: "19", commitment_type: "Pool", folio_id: "<a href="/capital_commitments/19">51694724</a>", unit_type: "Series C", investor_name: "<a href="/investors/28">Waterfield Advisors</a>", full_name: "", fund_name: "<a href="/funds/4">Macro Fund</a>", committed_amount: "1700000.0", collected_amount: "₹0.00", call_amount: "₹13,60,000.00", distribution_amount: "₹7,00,000.00", percentage: "20.0", onboarding_completed: "<span class="badge bg-warning"> No </span>", document_names: "", dt_actions: "<a class="btn btn-outline-primary" href="/capital_commitments/19">Show</a><a class="btn btn-outline-success" href="/capital_commitments/19/edit">Edit</a>", DT_RowId: "capital_commitment_19" },
How can I get back the same json but with numbers without quotes ? Note the default json.jbuilder template returns numbers as numbers.
To be more specific, Id like the id above which is returned as id: "19", to be returned as id: 19 without the double quotes. Any help is appreciated.
Regards