Questions tagged [rails-assets]
32 questions
0
votes
1 answer
Rails 5 assets not mentioned on the `applications.js` manifest are served?
Please enlighten me!
Let say I have the following assets structure in a Rails 5 application.
app/assets/javascripts
application.js
file1.js
In the application.js manifest I am not requiring //= file1 neither I am using require_tree .…

Miguel Hargreaves Pimenta
- 123
- 4
- 12
0
votes
0 answers
How to explicitly declare routes for assets?
I have an app where the routes are:
# many routes go here
# last item in routes.rb:
get ':username' => 'users#show'
This allows routes of the form www.example.com/your_username
This works perfectly, however, it seems to cause a bug with…

dss
- 395
- 3
- 11
0
votes
1 answer
Heroku: Stylesheet and Javascripts Not Updating for Rails 5 App
There have been many questions over many years where people have this issue. I have tried a combination of answers but I still can't get my updated stylesheet and javascript in my Rails 5.1.6 application to load in Heroku. It works on my local…

Pamela Cook - LightBe Corp
- 3,912
- 5
- 50
- 86
0
votes
3 answers
Background image not working in rails style.css on production
Background image style works fine on local as there is no digest on locale, but on production, after assets:precompile, all assets add fingerprints and there is no non-digested asset names in Rails 4. Due to this,
background-image:…

Haseeb Ahmad
- 7,914
- 12
- 55
- 133
0
votes
1 answer
Rails Assets intermittent Timeout https://rails-assets.org
Intermittently getting error when doing bundle install for this and also on Continuous Integration server.
Retrying dependency api due to error (4/4): Bundler::HTTPError Network error while fetching…

RodM
- 426
- 1
- 5
- 19
0
votes
1 answer
How can I organize js, css and scss files for proper import and pipelining?
Recently I bought a theme with assets in assets folders as:-
1) assets/js/something.js
2) assets/css/something.cs
3) assets/sass/main.scss (with import statements for files inside 3 no. dashboard folder and sub-folders inside dashboard)
4)…

codemilan
- 1,072
- 3
- 12
- 32
0
votes
1 answer
JavaScript won't work in Heroku deployment but works locally
I wrote this function in app/assets/javascripts/expand.js
$( document ).ready(function() {
var open = $('.toggle-expand'),
a = $('ul').find('a');
open.click(function(e){
e.preventDefault();
var $this = $(this),
speed…

Oliver Walker
- 25
- 5
0
votes
0 answers
in rails, javascript files load differently when switching between manifest files
I am using Rails and Bootstrap. I have a page that works perfectly when you just go to it in the browser. When I go to a different page on my site and then click a link that takes me back to the page, the javascript files load in a completely…

Philip7899
- 4,599
- 4
- 55
- 114
0
votes
1 answer
Rails Asset Pipeline problems with jquery-ui
Update
I downloaded the latest version of jquery 3.1 and jquery-ui from the jquery website. Unluckly this problem with the .effect() function is not connected to the asset pipeline. I had all the required js and css files included, but .effect()…

Fabrizio Bertoglio
- 5,890
- 4
- 16
- 57
0
votes
0 answers
unable to determine if controller based asset exists without .js extension rails
I have added assets for a controller and wants to include them per request.
The problem is that it does not include that assets without writing .js in controller path
The code on layout page is:
<%= controller_specific_js =…
user5084534
0
votes
0 answers
Deploy failed when running rake assets:precompile
Here are the capistrano logs:
The deploy has failed with an error: Exception while executing as deploy@server: rake exit status: 1
rake stdout: rake aborted!
NoMethodError: undefined method `each' for…

Vau
- 77
- 4
0
votes
0 answers
How to handle UJS when using Rails-assets.org Jquery (or exclude dependencies in a Rails-assets gem)
I've recently started using Rails-assets.org and noticed that, if a particular asset has jQuery as a dependancy, it installs a version from Bower when bundling. This duplicates the jQuery package in a Rails app (given the use of the default…

alopez02
- 1,524
- 2
- 17
- 36
0
votes
1 answer
Gem after successfully running bundle install not available
In my RoR project I want to use the DataTables Gem:
https://rails-assets.org/#/components/DataTables
I put the Gem with the right Source in my Gem file and run bundle install.
It outputs in green:
Installing rails-assets-datatables 1.10.12
And at…

almo
- 6,107
- 6
- 43
- 86
0
votes
1 answer
Stop rails from looking for controller specific JS and CSS
I'm using Rails 3.2 (old and unsupported, I know). It's a legacy application upgrade, and we didn't have controller specific js/css files previously, we have a different structure for them.
The problem is that the asset pipeline looks for…

Jono
- 3,393
- 6
- 33
- 48
0
votes
0 answers
Rails assets, client requesting expired assets
I have a rails (4.1.5) app deployed on Heroku and monitored with NewRelic. In the last 24 hours the site has gone from having < 3% errors on NewRelic to having ~30% errors and all the errors are to do with requests for expired javascript and css…

Sujimichi
- 466
- 7
- 16