Rhomobile page loading issue

M Madhusudhan Reddy 2 years 11 months ago
0 1 0

Hi All,

In my rhomobile (4.1.0) application am able to render to the next page when click the button, but the assets(css,jquery) is not loading when I press refresh button it is loading. I have added all the css and jquery files in the layout.erb file.

Here is my sample code,

index.erb
   
      Login Page
   

login_controller.rb
def login_request
     render :back => '/app'
end

Please help me on this.

-Thanks

Please register or login to post a reply

1 Replies

J Jon Tara

- Are you using jQuery Mobile?

- Is this creating a problem?

The second one seems like a silly question, but... are the pages then styled incorrectly, or is it simply that you have observed that the assets aren't again pulled-down from the internal Rhodes server?

jQuery Mobile normally ignores almost everything in when you load a page. That's because it's presumed to already be loaded. It just grabs the (meaningless in a Rhodes project) and ignores the rest of

In fact, in our apps, we do not include any scripts or styles in at all, except in the very first page loaded when the application starts up! This would be unacceptable on a website, because the user might refresh the browser, might save a bookmark, or some other site might create a deep-link to a page on your site. That's why you supply all the JS and CSS in of every page.

To clarify, when you use $.mobile.changePage() or simply include a link (which jQuery Mobile "hijacks" and then uses $.mobile.changePage()) jQuery Mobile loads a document from the server, and THROWS OUT almost everything in . Any CSS or JS included directly in are IGNORED. Any linked assets (JS files, CSS files) are not retrieved at all.

In an app, that's not necessary, so long as you only use $.mobile.changePage() and never use, e.g. WebView.navigate() which does a full document reload. (We've added a method called WebView.change_page in our projects.)

CONTACT
Can’t find what you’re looking for?