{"issue":{"state":"open","created_at":"2011-11-17T12:32:13Z","updated_at":"2011-11-19T00:58:52Z","comments":1,"user":{"gravatar_id":"9030766d563f89445905f6e9521736cb","id":734943,"url":"https://api.github.com/users/obduk","login":"obduk","avatar_url":"https://secure.gravatar.com/avatar/9030766d563f89445905f6e9521736cb?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Is it possible to add a method to be able to include all stylesheets from the application when compiled using the rails 3.1 asset pipeline so that the editor styling is the same as the rest of the website.\r\n\r\nAs a work around, I have implemented a dirty hack where the content_css init variable is set to the following:\r\n\r\nstylesheet_link_tag('application').split(\"\\n\").map{|stylesheet| stylesheet.match(/href=\"([^\"]+)\"/).to_a[1]}.join(\",\")\r\n\r\nIf anyone has any other ideas of a better way of achieving this, that would be great.\r\n\r\nThanks,\r\n\r\nOwen","assignee":null,"id":2268209,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":25,"title":"Set content_css to application css","closed_at":null,"html_url":"https://github.com/spohlenz/tinymce-rails/issues/25","milestone":null,"url":"https://api.github.com/repos/spohlenz/tinymce-rails/issues/25"},"action":"created","comment":{"created_at":"2011-11-19T00:58:52Z","updated_at":"2011-11-19T00:58:52Z","user":{"gravatar_id":"43da0307752bf635c44c33dcdd962a2e","id":7600,"url":"https://api.github.com/users/spohlenz","login":"spohlenz","avatar_url":"https://secure.gravatar.com/avatar/43da0307752bf635c44c33dcdd962a2e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I'd recommend going one abstraction level deeper in your helper and using the `asset_path` helper.\r\n\r\nHere's an (untested) example based on the `stylesheet_link_tag` helper:\r\n\r\n```ruby\r\ndef css_paths_for_tinymce(source=\"application.css\")\r\n  if debug_assets? && asset = asset_paths.asset_for(source, 'css')\r\n    asset.to_a.map { |dep|\r\n      asset_path(dep, :ext => 'css', :body => true, :protocol => :request, :digest => digest_assets?)\r\n    }.join(\",\")\r\n  else\r\n    asset_path(source, :ext => 'css', :body => false, :protocol => :request, :digest => digest_assets?)\r\n  end\r\nend\r\n```","id":2796573,"url":"https://api.github.com/repos/spohlenz/tinymce-rails/issues/comments/2796573"}}