create 関数の new 関数の params[:number] を使用する必要があります。これを行うにはどうすればよいですか?
def new
@test_suite_run = TestSuiteRun.new
@tests = Test.find(:all, :conditions => { :test_suite_id => params[:number] })
end
def create
@test_suite_run = TestSuiteRun.new(params[:test_suite_run])
@tests = Test.find(:all, :conditions => { :test_suite_id => //I need the same params[:number] here})
end
編集:私は、新しいものと作成したものの違いとして混乱していると思います。パラメータ :number を new に渡すことで取り込んでいます。
new_test_suite_run_path(:number => ts.id)
次に、それを使用してフォームを生成しています。その場合、作成機能で何をすべきかわかりません。コントローラーの create 関数を削除すると、フォームを new で送信すると、コントローラーに create アクションがないというエラーが表示されます。それは、すべてを new で create 関数に移動する必要があるということですか? create.html.erb を作成し、すべてのフォーム情報を移動する必要がありますか?