Reputation: 1461
If I try and include any .js
and .css
files downloaded from the jQuery Mobile website anywhere in the asset pipeline I get all kinds of view render problems, from not finding images to CSS not being applied, to errors in executing the jQuery js file. However, when I use the example code:
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
in the header of my Rails 3.2.11 app it just works.
Why is this?
I tried inclusion into application.js
and application.css
in a number of ways.
Upvotes: 0
Views: 969
Reputation: 927
jquery-rails
and jquery-mobile
to your Gemfile through their corresponding asset gems.Your Gemfile:
group :assets, :development do
gem 'jquery-rails'
gem 'jquery_mobile_rails'
end
Your asset manifests (application.js
and application.css
by default) should like like explained at: https://github.com/tscolari/jquery-mobile-rails#installation
Upvotes: 1
Reputation: 1461
Ok, so Mr. Vicente's solution is definitely the simplest, BUT it does not allow you to include custom CSS themes using the JQuery Mobile themeroller. What I have done is basically copy the raw CSS and put that into a 'Custom' css file, which in turn styles the provided themes as I want. Not ideal as you want to build custom themes yourself but OK.
Upvotes: 0