ビューとコントローラがうまく遊ぶのに問題があります。私は私のルーティングを混乱させたと思う、どんな助けも素晴らしいだろう。Rails3 form_tagルーティングエラー
<h1>AccountDetails#new</h1>
<%= form_tag(url_for(:controller => "account_details", :action => "new"), :method => "post") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Submit") %>
<% end %>
とき、私はgoto http://localhost:3000/account_details/new:
resources :account_details
マイnew.html.erbは、次のようになります。
class AccountDetailsController < ApplicationController
def new
puts "in new"
end
def home
puts "in home"
end
end
私のroutes.rbをは次のようになりますように
私のコントローラが見えます 私のページが表示され、私が提出したときに、私はこのエラーを受け取ります:
がPOSTを開始 "/ account_details /新しい" 0:0:0:0:0:0:0:1%0水で5月2日22時38分10秒-0400 2012
ActionController :: RoutingError ([POST] "/ account_details/new"と一致するルートはありません):
私は間違っていますか?私のルートは[POST]をカバーすると思いましたか?