1

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?

Chris Edwards
  • 3,514
  • 2
  • 33
  • 40
  • Same issue Chris. And one more problem comes. Two consecutive Back do not occur. i.e if I try to try to Back navigate twice, there is no back navigation for the second time. – Nitish Oct 21 '11 at 09:37

1 Answers1

1

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:

<div data-role="page" data-add-back-btn="true">

Then:

<div data-role="header" data-position="inline">
    <h1>Title</h1>
    <a href="page_back" class="ui-btn-left" data-theme="a" data-icon="arrow-l" data-rel="back" data-direction="reverse">Back</a>
</div>
Chris Edwards
  • 3,514
  • 2
  • 33
  • 40