Hi everybody! Beginner question here: I see that, generated by the scaffolding, when a form doesn't pass the validation on submit, it renders the new view through the create controller method. This is fine, it gives me access to the form errors and all the rest, but the URL doesn't change, so if the user refreshes the page they'll get an error or some other result on the browser. I know this is intended, because the user is supposed to just fill the
form again (correctly) and hit submit, but is there any workaround to protect ourselves from this behaviour? Thanks!
matthewd: I was referring that rails gives you an error if you don't have an index method, in my case, if I refresh it takes me to the index when I was meaning to refresh the "new" form
having an index method there is no error, it's just annoying, if you don't have an index method you would get an error saying that you can't request to that URL using GET
could you give me a good example to reconstruct the validation failure errors? I've been trying a few things but it's quite messy. For some reason I feel like this is very hacky and there should be another way to solve it
I guess I'd be happy enough rendering the new view from the create method as usual, but updating the URL in the browser, so the refresh scenario doesn't happen
but it still doesn't make sense to me.... I must be doing something wrong
Hello!! I'm new to Rails and I'm really excited! I find it very cool so far. Have a question though: I understand you can use rails generate scaffold for genereting almost everything, or you can do it for yourself generating your models and your controllers. Which one is the best way? I mean best practice (I guess the best way to learn is doing everything manually, isn't it?). Thanks! :)