I have recently begun the practice of using <%# Ruby on Rails comments %> in my html.erb files, as these do not display in the source code that is then viewable by a user.
Is there a way of adding comments to .css files that keeps them private from the eyes of devilish onlookers?
As @Eimantas already said: it’s not a good practice to send unminified version of JS/CSS files in production (you will get bad mark in YSlow for that).
There is a nice gem: http://github.com/thumblemonks/smurf
And it works like a charm: all you need is to mention it in your gem file (Rails 3)
and that’s it! Well, that’s it if you use :cache => … in your stylesheet_link_tag:
It intercepts standard Rails behavior that saves concatenated files to disk and compress them just before.
And to mention the obvious – it will compress the file only in production mode as the :cache option works only if cacheing is enabled.