Skip to content

{ Category Archives } Ruby

learning Ruby

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 [...]

Creating and deploying a Rails app

This documents how I create Ruby on Rails applications and deploy them to my server.  I have created a bare bones apache web server that hosts ruby applications using MySQL.  It also assumes you have Ruby on Rails set up on a Macbook Pro. Server Side User mkdir ~/myrumbleapp mkdir ~/myrumbleapp/www mkdir ~/myrumbleapp/www/current mkdir ~/myrumbleapp/logs [...]

Bare Ubuntu configuration for Ruby on Rails

General Install Ubuntu 9.1 server using the Bare Server option The first thing I like to do is add my account to the /etc/sudoers file. This just guarantees that I can always use sudo, even if I mistakenly mess up my group assignment. sudo visudo # /etc/sudoers root ALL=(ALL) ALL user ALL=(ALL) ALL user should [...]

Install Ruby on Rails for Mac Snow Leopard using MacPorts

Not sure why but I had a heck of a time running my ruby on rails code after updating my Mac to Snow Leopard. I use MacPorts to do my development so I simply removed it and all of my ports as well as the gem I had installed in my home folder.  I went [...]