All Questions

382
votes
18answers
149587 views

Rails 4: how to use $(document).ready() with turbo-links

I ran into an issue in my Rails 4 app while trying to organize JS files "the rails way". They were previously scattered across different views. I organized them into separate files and compile them wi...
92
votes
12answers
68413 views

ExecJS::RuntimeError on Windows trying to follow rubytutorial

UPDATE: Colin's suggestion of removing the line //= require_tree . has fixed the issue. I have wasted over 2 days trying to follow every suggestion out there and fix my issue. I am trying to follow t...
149
votes
6answers
51859 views

config.assets.compile=true in Rails production, why not?

The default Rails app installed by rails new has config.assets.compile = false in production. And the ordinary way to do things is to run rake assets:precompile before deploying your app, to make su...
376
votes
28answers
77620 views

Using Rails 3.1, where do you put your "page specific" javascript code?

To my understanding, all of your javascript gets merged into 1 file. Rails does this by default when it adds //= require_tree . to the bottom of your application.js manifest file. This sounds like a...
297
votes
11answers
143400 views

Using fonts with Rails asset pipeline

I have some fonts being configured in my Scss file like so: @font-face { font-family: 'Icomoon'; src: asset-url('icoMoon.eot?#iefix', font) format('embedded-opentype'), asset-url('icoMoon....
367
votes
14answers
51787 views

How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?

Sprockets tends to be quite verbose in the (dev) log by default under Rails 3.1 (RC1): Started GET "/assets/application.css" for 127.0.0.1 at 2011-06-10 17:30:45 -0400 Compiled app/assets/stylesheets...
75
votes
7answers
35189 views

Rails 3.1 asset pipeline: how to load controller-specific scripts?

If I generate a new controller in Rails 3.1, also a javascript file with the name of the controller will added automatically. Firstly, I thought this javascript file will used only, when the related c...
164
votes
3answers
41792 views

Using Rails 3.1 assets pipeline to conditionally use certain css

I’m in the process of building my first solo Rails app using Rails 3.1.rc5. My problem is that I want to have my site render the various CSS files conditionally. I’m using Blueprint CSS and I’m ...
96
votes
3answers
20623 views

Why did Rails4 drop support for "assets" group in the Gemfile

In Rails 3, gems used exclusively to generate assets in the asset pipeline were properly placed in the assets group of the Gemfile: ... # Gems used only for assets and not required # in production e...
121
votes
8answers
67698 views

No route matches [GET] /assets

I have a Rails app that I'm trying to test in the production environment. I ran RAILS_ENV=production rake assets:precompile which generated all of my assets in /public/assets. The problem is that when...

Previous Next