开发者

Ruby on rails: how can i add multiple css files in rails project?

开发者 https://www.devze.com 2023-03-19 04:47 出处:网络
How can i add multiple css files in rails pr开发者_运维问答oject ? I do, <%= stylesheet_link_tag :cssone %>

How can i add multiple css files in rails pr开发者_运维问答oject ?

I do,

<%= stylesheet_link_tag :cssone %>

Now i need to add more css file.


There are some method to achieve this. First of all, you can specify each manually :

<%= stylesheet_link_tag "first.css" %>
<%= stylesheet_link_tag "second.css" %>
<%= stylesheet_link_tag "third.css" %>

Then, you can wrap those 3 lines in a single one :

<%= stylesheet_link_tag "first.css", "second.css", "third.css" %>

Also, if you want to include all of your stylesheets in the dedicated rails folder (/public/stylesheets/), you can do :

<%= stylesheet_link_tag :all %>

If you have subfolders in the dedicated folder, you have to include the :recursive option

<%= stylesheet_link_tag :all, :recursive => true %>


<%= stylesheet_link_tag :cssone, :csstwo, and so on... %>


In your (assets/stylesheets) Add your multiple css file let us take eg-a.css,b.css and c.css

NOW

In application.rb write

<%= stylesheet_link_tag "first.css", "second.css", "third.css" %>
0

精彩评论

暂无评论...
验证码 换一张
取 消