varvet / pundit

Minimal authorization through OO design and pure Ruby classes
MIT License
8.28k stars 629 forks source link

Use redirect_back in README #732

Closed dgmstuart closed 2 years ago

dgmstuart commented 2 years ago

Inspired by https://github.com/varvet/pundit/issues/727 Thanks to @joemasilotti

Since Rails 5 (?) we have a more idiomatic way to redirect back to the previous page.

As it turns out this is pretty much just syntactic sugar for the previous implementation, but it feels like the more correct way to do it these days:(https://github.com/rails/rails/blob/de53ba56cab69fb9707785a397a59ac4aaee9d6f/actionpack/lib/action_controller/metal/redirecting.rb#L95-L128)