【发布时间】:2016-12-21 14:10:15
【问题描述】:
我想在浏览器的控制台中打印一个 JSON 对象,我搜索了很多但没有找到任何合适的结果。
这是我的红宝石控制器:
class ScheduleTime < ApplicationController
available_schedule = ScheduleTimeSlot.where(:doctor_id => params[:dr_id],:date=>params[:for_date].to_date,:status=>"vacant",:archive=>false).reorder(:start_time)
render :json =>{:available_schedules=>available_schedules}
//here I need a syntax that print the available_schedule on browser console (if possible) or ruby console, so I can debug it properly.
end
提前致谢
【问题讨论】:
-
找不到任何现有答案的原因是因为这没有任何意义。你能解释一下为什么你认为这是必要的吗?
标签: ruby-on-rails json ruby rails-console