任何人都知道如何采用this教程中提到的精彩方法,并使用绝对网址生成样式表标记?
答案 0 :(得分:0)
想出来。
在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我能做到!哇噢!