0
感叹 - Rails 3路由仍然让我感到困惑。这里的route.rb线 -Rails 3 URL Helper无法正常工作?
match "/ghosts/:pid" => 'ghosts#update', :constraints => { :method => 'PUT' }
这里的视图代码:
<%= form_tag (admin_ghosts_path(@pid), :method => :put) do |f| %>
这里就是获取呈现
<form accept-charset="UTF-8" action="/admin/ghosts.jbdlljhhxz" method="post">
但什么应该被渲染为
<form accept-charset="UTF-8" action="/admin/ghosts/jbdlljhhxz" method="post">
对此提出建议?此外,有没有办法有标准的路线:
resources :ghost, :only => [:index, :show, :update] do
get :index
get :show
put :update
end
使用“:PID”,而不是“:ID”而不做比赛就像我上面?
你得到支票 - 它最终成为我必须从鬼魂变为鬼魂,并从使用匹配格式,使用标准的'会员做'格式 - 顺便说一句,任何想法如何坚持价值在params [:pid]而不是params [:id]? – aronchick 2011-04-11 02:30:56