任何人都知道如何采取这个教程并使用绝对网址生成样式表标记?

有帮助吗?

解决方案

想出来。

在application_helper.rb中的内容:

def get_stylesheets
  stylesheets = [] unless stylesheets
  ["http://www.example.com/stylesheets/#{controller.controller_path}/#{controller.action_name}"].each do |ss|
    stylesheets << ss if File.exists? "#{Dir.pwd}/public/stylesheets/#{ss}.css"
  end
end

按宣传方式工作。太好了!

我一直想要这么做 - 现在感谢Rails我能做到!哇噢!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top