I am developing a rails 4 app with jQuery Mobile and using the jquery_mobile_rails gem which means I don't need to install any of the jQuery files. My problem is that there are no icons for the buttons. These are displayed in development but not in production. I assume that I just need to compile them but where are they and how can I do that?
Since I am not using jQuery Mobile files directly, I don't have the option to to store the icons below them. The gem works in development mode but not in production mode. Can I assume that the gems contain the button icons internally? If so, I am at a loss to understand why they don't work in production mode.
jquery-rails (2.3.0)
jquery_mobile_rails (1.3.0)
There is a known issue currently with Rails 4 when precompiling assets per environment.
Try setting:
config.assets.precompile=true
in config/application.rb
.
If that still doesn't work, try adding the following to config/application.rb
:
config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
I can't replicate the strange error you get when concatenating these files to config.assets.precompile
. Can you try the answer to this question instead (replace the line above):
config.assets.precompile << Proc.new { |path|
if path =~ /\.(css|js|png|jpg|jpeg|gif)\z/
full_path = Rails.application.assets.resolve(path).to_path
app_assets_path = Rails.root.join('app', 'assets').to_path
vendor_assets_path = Rails.root.join('vendor', 'assets').to_path
if ((full_path.starts_with? app_assets_path) || (full_path.starts_with? vendor_assets_path)) && (!path.starts_with? '_')
puts "\t" + full_path.slice(Rails.root.to_path.size..-1)
true
else
false
end
else
false
end
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With