Dainius

Joined

360 Experience
3 Lessons Completed
0 Questions Solved

Activity

Posted in Refreshing the page with form errors

Just realised that this is actually a bug in turbolinks, and does not look like it's going to be merged any time soon. https://github.com/turbolinks/turbolinks/pull/495

Posted in Refreshing the page with form errors

Hey all. Currently building a project with rails and so far really enjoying it. I've been using php & laravel for a long time and let me say ruby and rails are quite refreshing.

In laravel when you submit a form and it fails, you are redirected back with errors in the session. So refreshing the page will simply discard the errors from the session, but you stay on that same form page.

In rails, however, you post a form and instead of redirecting back, it display you the previous template. So the URL changes to let's say /users. Refreshing this page will either show me completely different page, or, give me 404 if I don't have index defined.

How do you guys deal with it? Is not a real problem? Personally this is very annoying to me, so I am looking for any workarounds.

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.