Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我 curl 或其他服务器调用我的服务器时,它会将格式解释为*/*. 由于我已经安装了 jbuilder,它总是用 json 响应。
*/*
如何调整格式的偏好顺序以响应*/*.
问题与respond_to行动有关。
respond_to
使用具有以下功能的操作:
respond_to do |fmt| fmt.json fmt.html end
任何类型的请求*/*都是 json。
要使其成为 html,您只需将其设为响应的第一种格式:
respond_to do |fmt| fmt.html fmt.json end
我有一个“日期时间”列,如下所示:2012-06-04 15:40:20.
2012-06-04 15:40:20
我想在 Doctrine 中创建一个查询,以获取以前的数据。小于2012-06-04 15:40:20。我怎么能在教义中意识到这一点。
对不起,我只是不知道。