在我的config/routes.rb中,我有:
post "portal_plan_document/update"
Run Code Online (Sandbox Code Playgroud)
rake路线证实了这一点:
$ rake routes
portal_plan_document_update POST /portal_plan_document/update(.:format) {:controller=>"portal_plan_document", :action=>"update"}
....
Run Code Online (Sandbox Code Playgroud)
在我的代码中,我有:
<%= form_for @plan_doc,
:url => portal_plan_document_update_path,
:method => "POST", :remote => true do |f| %>
Run Code Online (Sandbox Code Playgroud)
在我的日志文件中,我看到:
Started POST "/portal_plan_document/update" for 127.0.0.1 at 2011-03-31 18:04:37 -0400
ActionController::RoutingError (No route matches "/portal_plan_document/update"):
Run Code Online (Sandbox Code Playgroud)
我迷失了,因为从这里做了什么.任何帮助将不胜感激!
我应该声明我使用的是Ruby 1.9.2和Rails 3.0.5.哦,我在更新routes.rb后重新启动了服务器(WebBrick w/rails服务器).
杰里米
我正在尝试复制用C#中的Icon编写的文本报告.该报告包括:
Blah Blah........ $ 10,938.09
Blah Blah........ $ 3.88
Blah Blah........ $ 102,398.11
Run Code Online (Sandbox Code Playgroud)
我可以使用多个格式化调用来解决这个问题,例如:
Console.WriteLine(string.Format("Blah Blah.....${0,10}", number.ToString("#,##0.00")));
Run Code Online (Sandbox Code Playgroud)
但我认为有一种方法可以通过一次调用string.Format()来实现.知道如何以货币格式插入前导空格吗?