当我在ActiveAdmin中对模型的名称列进行排序时,我得到如下输出:
其中大写和小写字母似乎单独排序。我更喜欢以下列方式显示已排序的列:
在有效管理员中对列进行排序时,是否可以帮助我找出忽略区分大小写的另一种方法。我有一个postgres数据库这里是我的代码片段,但由于一些奇怪的原因不起作用:
package org.apache.cxf.transport.servlet.servicelist;
/*--imports--*/
public class FormattedServiceListWriter implements ServiceListWriter {
/*... this remains the same as in the original class*/
public void writeServiceList(PrintWriter writer,
String basePath,
AbstractDestination[] soapDestinations,
AbstractDestination[] restDestinations) throws IOException {
/*this is the method you should change*/
writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
+ "\"http://www.w3.org/TR/html4/loose.dtd\">");
writer.write("<HTML><HEAD>");
writer.write("<LINK type=\"text/css\" rel=\"stylesheet\" href=\"" + styleSheetPath + "\">");
writer.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">");
if (title != null) {
writer.write("<title>" + title + "</title>");
} else {
writer.write("<title>CXF - Service list</title>");
}
writer.write("</head><body>");
writer.write("<span class=\"heading\">WHATEVER YOU WANT TO PUT HERE</span>");
writer.write("</body></html>");
}
/*... this remains the same as in the original class*/
}
关于什么会导致它的任何想法?它只需要排序约30项。 (另外,我已经提到相关/可能的重复问题,但解决方案也不起作用,我不确定为什么逻辑似乎很好。谢谢!
答案 0 :(得分:-1)
https://github.com/activeadmin/activeadmin/blob/5b711b6e22230e6e28be2a9d7367e9423d5dcc25/lib/active_admin/resource.rb和https://github.com/activeadmin/activeadmin/blob/a473cb68baee260021957ba3d6c3398459a4c551/lib/active_admin/resource_controller/data_access.rb告诉我们ActiveAdmin为curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true)
构建自己的SQL
这里有一个问题描述了一些解决方案:https://github.com/activeadmin/activeadmin/issues/642