views:

292

answers:

1

Anyone know how to take the awesome method mentioned in this tutorial and have the stylesheet tags generate with absolute URLs?

A: 

Figured it out.

In what goes in the 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 been wanting to do this for ages - now thanks to Rails I can! Woohoo!

neezer