Skip to content

{ Monthly Archives } January 2010

css @font-face

Embedded fonts are almost a reality in web development.  All the modern browsers support the @font-face attribute.  Microsoft gets a lot of criticism for innovation, but they have had this ability since 1997 in Internet Explorer 4.0.  Unfortunately, they do not simply let you use a TTF font or an OTF font.  It uses an [...]

Ruby on Rails Nested Resources, Namespaces, and RESTful

I am working on a website where I have an admin section to add data and public read only sections.  I like to have a clean hierarchy of URLs.  I first implemented it using the standard generator code.  I had a /restaurants and a /locations url for both.  Locations doesn’t make sense as a top [...]

Ruby on Rails shell commands

This is just a reminder to me about commands that I use. rails appname rake –tasks rake db:create rake db:drop rake db:migrate script/generate controller myobject script/generate model Person name:string age:integer script/generate scaffold Person name:string age:integer

Ruby on Rails ORM through ActiveRecord

Rails offers an ORM layer.  This layer is not a very strict layer.  To filter or sort objects, you are actually writing SQL code.  There doesn’t seem to be much complaining in the community about this mis-feature.  In fact in the Agile Web Development with Rails book, the author basically makes snide comments about people [...]

Ruby on Rails Layouts

Site wide layout One common method of creating common look and feels in web development is to split up all the common code into a header file and a footer file and include those files in every single interface page.  This is better than embedding all that html code inside each page, but it is [...]

Fixtures and has_one in Ruby on Rails

In Rails 2.0, fixtures has been improved.  You no longer need to specify ID.  You can check out the screencast.  unfortunately, it does not support the has_one (as far as I can tell). I have a location object that specifies a phone number, a name, and an address object.  It is specified as follows: class [...]