Use preferred method of handling page change events.

As documented here:
http://guides.rubyonrails.org/working_with_javascript_in_rails.html#page-change-events