Need Clarification

I Need to find whether the user click on Browser back button in an Rails application, if clicked then need to show an alert for the same.

Please help me to find out a solution for this.