RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: ericeche
Site: www.umich.edu
Any progress in how to sort column data from associated tables using server side processing?
class Workshop < ActiveRecord::Base belongs_to :location, :class_name => 'Location' end class Location < ActiveRecord::Base has_many :workshops attr_accessible :name, end
Records are associated by id ( workshop.id = location_id)
On the Workshop datatable class, the information displayed is the location_name
class WorkshopsDatatable def data workshops.map do |workshop| { id: workshop.id, location: workshop.location_name, } end end
I would like to be able to sort the location column by location_name and not by location_id.
Any progress in how to sort column data from associated tables using server side processing?
Records are associated by id ( workshop.id = location_id)
On the Workshop datatable class, the information displayed is the location_name
I would like to be able to sort the location column by location_name and not by location_id.