Rails 3.1按特定顺序加载css

我看到在rails 3.1的开发环境中,css是按字母顺序加载的,而不是按照我想要的顺序加载。 我想要一个特定的css文件在最后,所以它覆盖了之前给予类的任何样式。 我们怎样才能做到这一点?

最好手动指定每个文件的顺序:

 /* * This is a manifest file that'll automatically include all the stylesheets available in this directory * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at * the top of the compiled file, but it's generally better to create a new file per style scope. *= require_self *= require reset *= require groups *= require the_last * 

你实际上可以这样做:

 /* *= require 'reset' *= require_self *= require_tree . */ 

在您的application.css文件中。 这允许您在树之前指定任意数量的样式表(例如重置),而无需指定每个单独的文件。 复位周围的单引号是可选的。

不试图复活旧线程,只是认为这可能对某些人有所帮助。