Rails: Tidy Stylesheets

Does anyone know how to take the great technique mentioned in this tutorial and create style tags with absolute urls ?

0


source to share


1 answer


Found it out.

In what's going on in 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

      



Works as advertised. Nice!

I've wanted to do this for ages - now thanks to Rails I can! Woohoo!

0


source







All Articles