I am currently doing this in the controller:
def index @orders = Order.all respond_to do |format| { format.html format.js { render json: @orders.as_json() } end
I have an order status field. The values ββfor this field are in English and must be translated into Dutch. The problem is that calling as_json does not automatically translate data into Dutch. YML file, current and standard locale all work correctly. (calling I18n.t works, but how does it work with as_json ()?)
Thanks!
source share