Is it possible to capture browser back button press
I am updating the page via
render :update do |page|
page.replace_html 'intainer', :partial => 'users/partial/trest'
end
So, when a user presses back, they (apparently) get taken back two pages. I would like to continue to use 开发者_JS百科the page.replace, however, I would like to know if there is a way to capture the back button press and call another page.replace to effectively change the page back to its previous state instead.
I suppose the alternative is to put a 'back' button, but that is less desirable.
Well i don't know ruby, but back button is browser stuff and ruby is server side language. You need to work with javascript here to do that.
精彩评论