菱形背部功能
我在 Rhomobile 中使用后退按钮功能时遇到问题。
我尝试过 url_for(:index, :back => ....) 等各种方法,但似乎没有任何效果。这种方法的问题是(即使它有效)它只允许导航到设定的位置,而不是动态历史记录/返回导航。
我最接近的工作解决方案是在 application_helper: 中使用它
def page_back
WebView.navigate_back
end
,然后在视图中使用 Back
。
这是可行的,我可以跨视图甚至控制器进行导航。但是,它会生成“加载页面时出错”错误,即使它确实呈现了正确的页面......
有人有任何想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,这就是我最终所做的。我现在决定不使用 rhodes,但这是我针对此问题想到的:
将
data-add-back-btn="true"
添加到:然后:
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: