我需要为<h:commandButton>
while 创建一个回调作为参数,我需要传递一个与外部参数id字符串连接的参数:
我尝试嵌套一个这样的EL表达式:
<h:commandButton ... action="#{someController.doSomething('#{id}SomeTableId')}" />
Run Code Online (Sandbox Code Playgroud)
然而,由于EL异常,这失败了.这样做的正确语法/方法是什么?
下面是我的nginx.conf.
如果不存在的文件/index.php
服务很好.
但是当我的URL /foo/bar => /foo/bar/index.php
通过下载作为PHP源代码提供时.
有任何想法吗?
try_files $uri $uri/ $uri/index.php /index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Run Code Online (Sandbox Code Playgroud) 我有一个非常简单的问题.试图弄清楚在rails 3中路由自定义操作的最简单方法是什么.
假设我有控制器UsersController
和动作promote_to_premium
也不
http://localhost:3000/users/#{user_id}/promote_to_premium
Run Code Online (Sandbox Code Playgroud)
也不
http://localhost:3000/users/promote_to_premium/#{user_id}
Run Code Online (Sandbox Code Playgroud)
作品.
我应该在routes.rb中指定每个与new/delete/update/create/ect/....不同的自定义操作吗?
谢谢.
假设我需要知道我一生中赚了多少钱:我在SQL中做的是这样的:
select sum(salary) from employee_salary where employee_id=1000;
Run Code Online (Sandbox Code Playgroud)
有没有一些简单的方法可以通过mongoid,rails在mongoDB中执行此操作?甚至不要考虑建议我使用map/reduce.
我发现最简单的方法是:
db.employee_salary.group(
{
cond: { "employee_id":1000 },
reduce: function(obj,prev) { prev.sum += obj.salary; },
initial: { sum: 0 }
}
)[0].sum;
Run Code Online (Sandbox Code Playgroud)
但它看起来很可怕......
configure:error:时间戳支持需要Curl 7.12.0或更高版本
我在尝试./configure
另一个包时有这个消息.已安装CURL
有一个输出
benny@ubuntu:$> apt-cache search libcurl
gnupg - GNU privacy guard - a free PGP replacement
libcurl3 - Multi-protocol file transfer library (OpenSSL)
libcurl3-dbg - libcurl compiled with debug symbols
libcurl3-gnutls - Multi-protocol file transfer library (GnuTLS)
libcurl3-nss - Multi-protocol file transfer library (NSS)
libcurl4-gnutls-dev - Development files and documentation for libcurl (GnuTLS)
libcurl4-nss-dev - Development files and documentation for libcurl (NSS)
libcurl4-openssl-dev - Development files and documentation for libcurl (OpenSSL)
python-pycurl - Python bindings …
Run Code Online (Sandbox Code Playgroud)