views:

18

answers:

1

Here's the scenario of out of the box map.resources

I'm on /users/new Submit -> /users/ rescue error render new URL: is /users/

If User.index never defined. I copy the URL to another tab, it'll have routing error.

How can I have the URL showing /users/new while activerecord errors persists on the page?

A: 

This is a common issue with rails restful routes.

What happens is you are on /users/new and when you submit if there is an error it simply does

render :action => 'new' 

This causes your POST route to still show in the address bar but render the action new. When you try to copy this URL it is invalid.

The guys over at expected behavior have a fix on github for this that takes advantage of html5

http://github.com/expectedbehavior/fix_you_some_address_bar

davydotcom
the plugin breaks in rails3
Rex Chung