I’m having a problem getting the back button function to work in Rhomobile.
I’ve tried various methods of url_for(:index, :back => ....) etc etc and nothing seems to work. The problem with this method is (even if it worked) that it only allows navigation to a set place, rather than a dynamic history/back navigation.
The closest I’ve come to a working solution is by using this in the application_helper:
def page_back
WebView.navigate_back
end
and then <a href="page_back">Back</a> in the view.
This works, and i can navigate across views and even controllers. However, it generates a “Error loading page” error, even though it does actually render the right page…
Does anybody have any ideas?
Ok this is what I did in the end. I’ve decided against using rhodes now but here is what I came up with for this problem:
Added
data-add-back-btn="true"to:Then: