Hi!
I’m developing facebook apps with ruby on rails. My connection is really slow. The stylesheets do not load mosts of the time.
So i want to print out the content of my .css-files in Tags. Is this possibe with some parameter to the stylesheet_link_tag or an other tag?
I'm developing facebook apps with ruby on rails. My connection is really
slow. The stylesheets do not load mosts of the time.
So i want to print out the content of my .css-files in <style> Tags. Is this
possibe with some parameter to the stylesheet_link_tag or an other tag?
My understanding is that stylesheet link tags *never* work in Facebook canvas apps. You have to include them inline.
I don't think there is a built in way to do it, but you could use stylesheet_path in conjunction with RAILS_ROOT and File.read to write a little helper method to do it.
Something like...
def inline_stylesheet(source)
"<style type='text/css'>" +
File.read("#{RAILS_ROOT}#{stylesheet_path(source)}") +
"</style>"
end
For normal stylesheet link tags works fine in facebook. In our production environment this is no problem. Also it wasn’t a problem for a long time from my development-system.
But when i started to include kontagent the whole thing slows really down.
Thanks for your approach - I hoped that there is an easier way out there