Multi-select list boxes in RubyOnRails

Multi-select list boxes in RubyOnRails are pretty simple if you have an example to refer to. Here's a silly attempt to build a UI where the user selects the flavors of ice cream for an ice cream sunday.

<%= select_tag 'flavors[]',
optionsforselect( [['vanilla','1'], ['strawberry','2'], ['chocolate','3']] ),{ :multiple => true, :size =>5 } %>

Some key point here are


Read Full Entry ...

-- Mark Windholtz

Testing time specific events in RubyOnRails

or It's high time for DRY Time

Testing support in Rails is great. But testing time specific events is still tricky. Certainly, you can put time relative data in your fixtures like this ...

first: id: 1 started_at: <%= Time.now.strftime("%Y-%m-%d %H:%M:%S") %>

The trouble is that this would be repeated all over the place. A violation of the DRY principle and therefore the fixtures become WET. And it's ugly looking code.


Read Full Entry ...

-- Mark Windholtz

Fix it and Break it

Clients often ask for Fixed price software bids. The desire is understandable, everyone wants to know the answer to the question what's it going to cost me?

Often new Ruby On Rails software developers eagerly accept Fixed price work. It usually ends badly.

With fixed price contracts, one side always loses, sometimes both.

Either the project comes in early, and the customer paid too much. Or the project runs longer than expected and the developer works hours for free. Sometimes this mistake can put the the developer out of business. And eliminate product support for the client.


Read Full Entry ...

-- Mark Windholtz

3 hours to Power

We've been getting enquiries for Rails work.
So we decided that we needed a way to track potential clients and projects. Simple stuff, like which one of us got the call, who it was from, project notes, start-date, and next steps.

Sure there are packages that do this sort of thing. I imagine that most are expensive and too complex for our modest needs. So I took 3 hours and built a Rails application, using the LoginEngine and a few tables. I attached it to our current time tracking application and deployed it on the web for us to use.

Total time including deployment: 3 hours

We now have a client-tracking application that is tailored to our needs. It is simple, secure, minimalist, easy to use and has no license fees. And we can extend it as our client-tracking needs increase, to support exactly how we work.

I just can't imagine doing this with a technology like Java or .NET. It just would have taken too long to even get started. We would have used a wiki, or a shared excel file, or something less optimal.

Rails changes how you think about what is a worthwhile application. It gives you the power to put ideas to work, quickly.

It was a good morning.


-- Mark Windholtz