Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL/body are wrong after invalid form submission #398

Closed
samanpwbb opened this issue Jul 30, 2013 · 8 comments
Closed

URL/body are wrong after invalid form submission #398

samanpwbb opened this issue Jul 30, 2013 · 8 comments

Comments

@samanpwbb
Copy link
Member

Is this just on my local build of OSM or is this a real problem?

screen shot 2013-07-30 at 5 39 58 pm

The content inside body is correct, but:

  • Body class should be user user-new not user user-terms
  • URL should be /user/new not /user/terms
@tomhughes
Copy link
Member

Hmm.... It's not wrong as such, it's just an odd side effect of the way the signup works...

The initial form is /user/new but when you submit it posts to /user/terms which would normally then display the terms page, but if there is a validation error it renders the new view again, but of course the action is still terms so that is the class which gets assigned...

@jfirebaugh
Copy link
Member

The typical Rails pattern would be to POST to /user/new, which redirects to /user/terms on success.

@tomhughes
Copy link
Member

Sure - the problem is making sure we somehow preserve enough state, because we need to remember all the form data from the first page until we are ready to create the user record, which only happens after the terms have been accepted.

Currently that works via hidden parameters on the terms page I think.

@tomhughes
Copy link
Member

Actually it looks like we create the record and save it in the session now, and only save it to disk at the very end, so we can probably rearrange this fairly easily.

@samanpwbb
Copy link
Member Author

This is causing so e problems for me when trying to do things based on body classes. I can stop relying on body classes if this is a difficult problem to fix.

@jfirebaugh
Copy link
Member

@tomhughes Are you working on this? Otherwise I can take it.

@tomhughes
Copy link
Member

@jfire Feel free to have a go at it - it's all a bit messy though I'm afraid...

@tomhughes
Copy link
Member

Fixed by merging #405.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants