Archive for the ‘Opinions’ Category

AuthLogic is awesome!

Probably every Rails developer has used restful_authentication. Most of us on practically every application. But restful_authentication generates quite some code and is somewhat an odd plugin. It is a bit out of place in the regular restful controllers that you make. They are making a new modular version of it, but it isn’t much of an improvement, if you ask me.

Luckily, there is a new plugin/gem that does this better. It’s called AuthLogic. It used to be called AuthGasm, but now we can actually install it without blushing every time we do ls vendor/plugins. It gives you a familiar acts_as_authentic for your user model (nothing more, mind you!) and a UserSession model, which isn’t inheriting from ActiveRecord, but from AuthLogic::Session::Base class, which AuthLogic provides.
Read more

  • Print
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • Twitter

Finally! Rails goes i18n!

Important!

I18n.store_translations isn’t available anymore and all scopes have changed. Please DON’T use this anymore as a literal guide, because a lot has changed since I wrote this. Don’t use the i18n_yaml plugin, because most of it’s functionality has been merged into Rails. Please look for one of my more recent posts here.

It has been some time, I know. It was a busy time. Since my last post I started working at Finalist IT Group, an exciting company doing exciting projects. Right now I’m doing a very demanding project for Eindhoven city council, which is quite far away from my home (well, in Holland it is anyway).

But time hasn’t stopped. Ruby on Rails is busy advancing to version 2.2. One new feature in the upcoming Rails version has caught my eye and my undivided love and attention. It’s the I18n-module built into Rails! It is already available if you’re running edge.

Read more

  • Print
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • Twitter

Second Haml evaluation

After using Haml for over a month now, I can now really evaluate how Haml is to work with from day to day basis.

Haml actually is a blessing. Doing minor adjustments is very easy, your code remains looking nice, the output keeps looking nice. Just be sure to know how to shift blocks of code to the left or right in your favorite editor. Read more

  • Print
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • Twitter

First Haml evaluation

As I promised, here is the evaluation of redoing a site from ERB to Haml. To immediately cut to the chase: Haml IS worth it!

  1. It’s so definitely faster and easier to write than ERB.
  2. Your HTML output is nicer.
  3. Partials rendering with the right indentation automatically.
  4. It forces you to take a good look of what you’re actually making.
  5. Because it’s so strict on it’s syntax, you will be using more helpers and custom model methods, which is a good thing.
  6. No more forgetting to close a div and spending hours to find out which one.
  7. Faster refactoring because of less code and easier to read.

There are some downsides however. I’d rather not talk about the hours I tried to fix some idiot problem with partials and the locals option. Just use locals as less as possible, preferably not at all. Read more

  • Print
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • Twitter

The Knights Templater part II: Priory of Haml

Of course it’s no problem to upgrade from Ruby on Rails 1.2.6 to 2.0.2. Just make sure you don’t fuck up your subversion when unfreezing the old and freezing the new version. I just wanted to have that out of the way, before starting this new adventure.

My current project (not being the same as the one from my previous post about the knights templater) in which I totally wrote 123 views, of which 48 partials. Since this project was so Agile, it would have made fucking of the ugly fat girl from some party look like it had been planned and completely documented months in advance, it has become a jungle of views rendering partials rendering partials rendering partials. The HTML had come from the templaters, the functionality is all finished. All we (Arie and me) need to do now is completely reimplement all the views. Yuck! Read more

  • Print
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • RSS
  • Twitter
Return top

About me

I am a Ruby programmer from Rotterdam, Netherlands. I started working with Ruby on Rails about 3 years ago and I've fallen in love with the language ever since.

When learning Ruby I noticed that the most useful information comes from blogs of other Ruby developers. I try to contribute to that.

I also am into writing plugins and gems. I hope you like my contributions and leave a comment if you do.