My previous post on installing Ruby 1.9.2 in combination with Xcode 4.3 generated some interest. Since that writeup I did a fresh install of a Lion machine. So here is a follow up post. I think this is the better way to go.
Continue reading Installing Ruby using RVM, Homebrew and Xcode 4.3.
Well, had a hard time today installing some gems.
I installed Xcode 4.3 yesterday ( with it’s command line tools ) and tried to build a little test app.
I wanted to load a little data into the test app so I decided to create a Sinatra app. An iOS app without some server interaction? Boring!
Continue reading RVM + Ruby 1.9.2 + Xcode 4.3
When using Rails, you’re using migrations a lot. Migrations are awesome. But today I ran into a problem. I had to convert a column to be of type :boolean ( it was of type :text ). I was suprised when things went wrong.
Continue reading Change a column type when using Postgresql in Rails migrations
Well, this thing got me going for a couple of hours before things worked out. Using HTTPService did not seem to be the way to go. Long story short: URLRequest to the rescue!
Continue reading How to PUT xml to a REST interface with Basic Authentication
Just found this potentially usefull tool to analyse your Rails logs visually. It handles drag ‘n drop and has some pie charts in it.
Rails Log Visualizer
This is an amazing book. Not only does it handle what it says on the cover, but it also touches advanced use of SVN, common security issues with Rails and so on. 5 out of 5 stars!
Very easy this one:
Contact.rb ( Model )
@name_and_company = name + " - " + contact.company.name
Usage ( note the use of :name_and_company )
<%= form.collection_select(:contact_id, @contacts, :id, :name_and_company ) %>
Short story: I needed a table that could visualize the relation between two other tables ( services & portfolio ). So I set up a “join table”; a table that has two columns: service_id and portfolio_id. Each column contains a foreign key ( services.id and portfolio.id ).
Now, what you normally do is add a third column “id” as primary key. But in this case it can be a recipe for ( a programmer’s ) disaster. The column id would always contain a unique value, but the combination of the two other columns service_id and portfolio_id will not be unique. And thus you could run into a situation where you have multiple rows that hold the same relation:
Continue reading The story of compound keys
Title says it all 🙂 Another one to add to the pile that is “Ruby on Rails editors”.
Netbeans 6.0 bèta pages