Home Redirect (Refresh) your current page
Post
Cancel

Redirect (Refresh) your current page

I’m not sure why I was unable to find this out on the internet, but here’s the simple piece of code you need in your controller to refresh your page:

1
2
3
4
5
6
current_user.verified = true  
current_user.save  
flash[:notice] = "You’re verified!"  

#Redirect/Refresh  
redirect_to :back

I call this a refresh, but technically we’re just going back (to where we came from).

Shout out to Ben for finding it!

This post is licensed under CC BY 4.0 by the author.