2 ms·
Not sure if I 100% understand, but it sounds like maybe you want to rescue the exceptions you can think of explicitly, then redirect_to previous_thing and retu
by seanp2k2 11y ago
Not sure if I 100% understand, but it sounds like maybe you want to rescue the exceptions you can think of explicitly, then
redirect_to previous_thing and return
- pjungwir 11y agoExactly. Something like this: if @foo.save flash[:success] = "Saved" redirect_to foos_path else redirect_to new_foo_path end The standard pattern is to `render 'new'` rather than doing the latter redirect. So I'm complaining that my preferred way isn't "blessed" by the Rails community. Also you need a trick to keep @foo.errors in between requests and load it up in your #new method the second time around.