John Topley’s Weblog

Rails Tips #1: Local Documentation

This is the first in a series of occasional bite-size Ruby on Rails tips that’s as much for the benefit of my memory as anything else. If you’re using RubyGems then you can view the Rails’ RDoc documentation locally by typing:

gem_server

—And then going to http://localhost:8808.

Three Gigs/One Week

  • 17 May 2006: The Divine Comedy at The Junction, Cambridge
  • 19 May 2006: Morrissey at Portsmouth Guildhall
  • 23 May 2006: Glenn Tilbrook at The Jazz Cafe, Camden

Click below to view pictures and video clips.

The Divine Comedy Portsmouth Guildhall ceiling The Divine Comedy The Divine Comedy Morrissey
The Divine Comedy   The Divine Comedy Glenn Tilbrook Glenn Tilbrook
The Divine Comedy The Divine Comedy Glenn Tilbrook   Glenn Tilbrook
Glenn Tilbrook The Divine Comedy The Divine Comedy Glenn Tilbrook The Divine Comedy
Glenn Tilbrook The Divine Comedy Morrissey Morrissey Glenn Tilbrook
Glenn Tilbrook The Divine Comedy Glenn Tilbrook Glenn Tilbrook  
Morrissey   The Divine Comedy Glenn Tilbrook  

Workshop Review: Professional CSS XHTML Techniques

On Friday I attended a Professional CSS XHTML Techniques workshop given by Eric Meyer and organised by Carson Workshops. The event was superb; it’s clear that Eric has probably forgotten more about CSS than most of us will ever know, yet he was able to impart some of his vast knowledge and experience in a digestible and accessible manner. He was a pleasure to watch and listen to and a nice guy who answered everyone’s questions thoughtfully and patiently.

I learned lots of things about CSS that I didn’t know before or only vaguely understood, including:

  • The values of attributes within XHTML aren’t case-sensitive, apart from class and id attributes.
  • Everything looks like an element to CSS. It’s possible to write CSS that displays and styles elements that are normally supressed by browsers. For example, the head and title tags.
  • The content: declaration can be used to generate content. The print stylesheet at A List Apart uses this to good effect to display link URLs. This doesn’t work in IE though (including IE7).
  • The “Cascading” in Cascading Style Sheets refers to specificity processing, not to the inheritence of declared values across elements.
  • Inherited values have a null specificity.
  • The universal selector (*) has a specificity of 0 0 0 0. It’s equivalent to listing every XHTML selector explicitly in the stylesheet.
  • The universal selector is handy-dandy for stripping out browser defaults.
  • If selectors have equal specificity then the tiebreaker is the order listed in the stylesheet—last one wins.
  • !important trumps specificity, even for inline style declarations. IE7 supports it properly, whereas IE6 supports it but has a buggy implementation.
  • !important isn’t inherited.
  • !important can be used to diagnose specificity conflicts by temporarily boosting the specificity of a selector.
  • Link selectors have to be listed in a:link, a:visited, a:hover and a:active (LoVe HAte) order because all four selectors have the same specificity, so the selector order in the stylesheet comes into play.
  • Listing selectors in alphabetical order within a stylesheet is generally a bad idea because it can introduce specificity conflicts.
  • IE7 should be considered roughly equivalent to Firefox in terms of CSS rendering behaviour.
  • IE6 only sees the last class or pseudo-class when multiple classes are assigned to an element.
  • Absolutely positioned elements cannot affect other elements because they’re outside of the normal flow.
  • The order in which elements appear in the source is significant for floated elements.
  • Clearing an element resets the top margin for the cleared element.
  • Elements that are in the normal flow don’t establish position context for other elements, which is why container elements need to have position: relative in their declaration block.
  • Line height can be specified in the shorthand font declaration syntax e.g. font: 1em/1.2em Verdana, Arial, sans-serif; specifies a font with size 1em and line-height 1.2 em.

Pimping Carson Systems: Bare Naked App

Sorry to pimp Carson Systems again, but they’ve just launched a new site that details the entire process of bringing their second Web application—Amigo—to market. It’s informative and interesting stuff, although I find it a bit odd that they don’t actually say anywhere what the application will do! I’m sure all will be revealed soon enough.

(Update: I’ve just read the About page and it turns out that it does say that the only thing they won’t reveal until launch is what the app does).

Preventing SVN Exposure

Dan Benjamin over at Hivelogic writes about not exposing information about your Subversion repository if using Capistrano to deploy a Ruby on Rails application. Looks like required reading if you’re using these tools.


Archives

  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

More Archives


Sign In