【发布时间】:2008-11-18 22:02:35
【问题描述】:
有谁知道如何采用this 教程中提到的绝妙方法并使用绝对 URLs 生成样式表标签?
【问题讨论】:
有谁知道如何采用this 教程中提到的绝妙方法并使用绝对 URLs 生成样式表标签?
【问题讨论】:
想通了。
在 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,我可以做到!哇哦!
【讨论】: