Stylesheet_link_tag does not reference / asset in the Rails pipeline

I am trying to upgrade from Rails 3.0 to Rails 3.1. I used to use Jammit for assets, after a few steps I got to the point where everything looks pretty good, except for the CSS part. When I use javascript_include_tag and image_tag , it generates the correct link to /assets in development, but when I use stylesheet_link_tag for css, it saves the generated links to /stylesheets instead of /assets .

What is the problem?

There are several questions related to my problem, and I did everything they said correctly, but I still can’t find a solution to the problem. Related questions:

Update

I myself found the problem that the gem used by me overrides the default behavior of Raild resource tag helpers.

+4
source share
1 answer

I had the same problem, and the culprit turned out to be the old version of "mobile fu."

I used version 0.2, and updating to version 1.1 resolved the issue for me. Version 0.2 smoothed the "stylesheet_link_tag" method in such a way that it interfered with the Sprockets :: Helpers :: RailsHelpers module. I found an offensive bit of code using grepping through all my Gems for "stylesheet_link_tag" to see where it might have been overridden.

I hope this helps anyone who encounters this problem in the future :).

0
source

Source: https://habr.com/ru/post/1393503/


All Articles