There was some discussion on this list recently about doing .rcss templates in Rails using a custom template handler. I''ve come up with a very simple way to support rcss without a handler. Turns out all it takes is a route and an action that calls render(:file...). I put a full write-up on my blog earlier today: http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss- templates Of course if anyone sees a simpler way to accomplish this, I''m all ears... --josh http://blog.hasmanythrough.com
On Thu, Mar 23, 2006 at 02:56:35PM -0800, Josh Susser wrote:> There was some discussion on this list recently about doing .rcss > templates in Rails using a custom template handler. I''ve come up > with a very simple way to support rcss without a handler. Turns out > all it takes is a route and an action that calls render(:file...). I > put a full write-up on my blog earlier today: > > http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss- > templates > > Of course if anyone sees a simpler way to accomplish this, I''m all > ears...Are you familiar with this? http://lunchroom.lunchboxsoftware.com/articles/2005/08/19/rcss-anyone http://lunchroom.lunchboxsoftware.com/articles/2005/08/22/css-builder-to-join-builder http://lunchroom.lunchboxsoftware.com/articles/2005/08/26/css-builder-available-via-css http://lunchroom.lunchboxsoftware.com/articles/2005/09/01/cssbuilder-three-more-constructs http://lunchroom.lunchboxsoftware.com/articles/2005/09/02/selector-grouping-builder marcel -- Marcel Molina Jr. <marcel@vernix.org>
Marcel Molina Jr. wrote:> Are you familiar with this? > http://lunchroom.lunchboxsoftware.com/articles/2005/08/19/rcss-anyone > http://lunchroom.lunchboxsoftware.com/articles/2005/08/22/css-builder-to-join-builder > http://lunchroom.lunchboxsoftware.com/articles/2005/08/26/css-builder-available-via-css > http://lunchroom.lunchboxsoftware.com/articles/2005/09/01/cssbuilder-three-more-constructs > http://lunchroom.lunchboxsoftware.com/articles/2005/09/02/selector-grouping-builderYes, I discovered that in my investigations. But I wanted something that a designer could use so I didn''t want to go with the Builder-style syntax. ERb is simple enough for someone who is coming from HTML/CSS/PHP land, but I don''t want to drop yet another new syntax on a designer. Regular CSS with ERb is pretty much ideal for my needs. Now, how many different things called RCSS are there already? And how many will there be eventually? :-) --josh http://blog.hasmanythrough.com -- Posted via http://www.ruby-forum.com/.
> ERb is simple enough for > someone who is coming from HTML/CSS/PHP land, but I don''t > want to drop yet another new syntax on a designer. > Regular CSS with ERb is pretty much ideal for my needs.I think I missed the original question but would have to agree here. Although I suspect this is probably true for other designers, just speaking for myself, working with CSS and remembering all the hacks and tricks is hard enough without having to learn Yet Another Syntax. Free-lancers like myself work with all kinds of developers using different platforms and having to learn a special syntax just for some RoR projects but not every RoR project... well, that''s cool and I''d be open to doing that. But, I''d rather spend my time and more importantly perhaps, I''d rather spend your or your client''s money on doing design work and not learning RCSS or what-have-you. Just trying to be pragmatic about all this... :) Additionally, a designer can organize their CSS files and rules so that something like RCSS is largely not needed. Doug Bowman over at stopdesign.com has some interesting techniques as some other CSS-gurus out there.
> Additionally, a designer can organize their CSS files and rules so that > something like RCSS is largely not needed.not knowing what RCSS is, it sounds like it might be a good solution to user-definable themes & layouts'', at least without spewing <script> crap into the top of each page.. -- Posted via http://www.ruby-forum.com/.
poomplex wrote:>> Additionally, a designer can organize their CSS files and rules so that >> something like RCSS is largely not needed. > > not knowing what RCSS is, it sounds like it might be a good solution to > user-definable themes & layouts'', at least without spewing <script> crap > into the top of each page..Since my original post seems to have gotten lost from this thread... RCSS is just CSS with embedded Ruby, just like RHTML is HTML with embedded Ruby. Of course, there are at least two other things out there called RCSS as well - one uses a "server-side includes" syntax, and the other uses Builder syntax like RXML files. I can''t claim that either of them are less justified at using the RCSS moniker than the CSS + ERb approach I prefer, but I don''t see that that''s a problem. Yay for anarchy. You can find my writeup of my RCSS template solution here: http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss-templates --josh http://blog.hasmanythrough.com -- Posted via http://www.ruby-forum.com/.