0

Here's the situation.

  1. A user goes to the #new action, clicks submit form, and the object is created. The user is shown the show page
  2. The user realizes something is wrong, so they click back (even though there's clearly an edit button there)
  3. The user fixes whatever needs fixing and clicks submit again, thus creating a new object

What I want to do is have the user directed to the edit action when they click back on the show page. It's also got to be IE 7+ compliant. Is this possible?

Another alternative I was considering was creating a random string on a hidden field on the #new page, and using that to check whether the object's already been created.

Thoughts?

4

1 回答 1

1

我会在 javascript 中使用

document.referrer

在新页面上查看用户来自哪里,如果它是创建的页面,然后您可以执行任何必要的操作以转到编辑视图。

于 2013-05-15T15:57:43.347 回答