如果我在一个路由别名,如/ register,我有一个表单错误,我渲染:新,有可能是/注册路径仍然可以?重定向到表单上的路由别名验证错误
在它呈现的那一刻/新
我可以做一个redirect_to的register_path但随后我就失去了PARAMS?
它让下面的测试失败:
Scenario: Try registering with a bad staff number
Given I am on the registration page
When I fill in "email" with "[email protected]"
And I fill in "First Name" with "Kevin"
And I fill in "last name" with "Monk"
And I fill in "Employee Number" with "something barking123"
And I press "Register"
Then I should be on the registration page
And I should see "Your employee ID number looks incorrect."
我问过类似的问题并得到答案,请参阅http:// stackoverflow。com/questions/1083798/use-custom-route-model-validation-failure – 2010-05-07 14:18:46
为了爱上乔布斯,请纠正最后一句中的语法。您不希望您的网站出现在Error'd上。 “您的员工ID号码看起来不正确。” – mcandre 2010-05-25 16:50:31
哦,是啊!好点子。你的权利! – 2010-05-26 18:04:34