Can't get stylesheet to show up in ruby app

心已入冬 提交于 2019-12-24 15:19:24

问题


I have the following code in my application.erb file in my layouts directory. I have the blueprint directory inside of public/stylesheets however the link doesn't work. It says it is supposed to be located at <link href="/assets/blueprint/screen.css" media="screen" rel="stylesheet" type="text/css" /> But There is nothing there.

<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
    <%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>

回答1:


use this<%= stylesheet_link_tag "/blueprint/screen" %> & place your screen.css in the following heirarchy:

app/assets/stylesheets/blueprint/screen.css



来源:https://stackoverflow.com/questions/9123661/cant-get-stylesheet-to-show-up-in-ruby-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!