【发布时间】:2010-05-07 12:06:51
【问题描述】:
如果我在 /register 之类的路由别名上并且出现表单错误并呈现 :new,那么路径是否可能仍然是 /register?
目前正在渲染/new
我可以做一个 redirect_to register_path 但我会丢失参数?
它使以下测试失败:
Scenario: Try registering with a bad staff number
Given I am on the registration page
When I fill in "email" with "kevin@acme.com"
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."
【问题讨论】:
-
我问了一个类似的问题,得到了答案,见stackoverflow.com/questions/1083798/…
-
为了乔布斯的爱,请纠正最后一句的语法。您不希望您的网站出现在 Error'd 上。 “您的员工 ID 号看起来不正确。”
-
哦,是的!好点子。你的权利!