Read about:

Posts Tagged ‘Rails’

LDAP-based RBAC with ActiveLdap and declarative_authorization


If you followed my previous tutorial on implementing pass-through authentication to LDAP with Authlogic, you might be wondering how it can be extended to give different permissions to members of different LDAP groups. ActiveLdap and declarative_authorization make this incredibly simple.
Read the rest of this entry »

Creepy Rails Error Message


Below is a screenshot of an error I received from my day job Rails app while I was testing it yesterday. I think it might be trying to tell me something…

Could not find workitem with ID=666

Could not find workitem with ID=666

I got this when I was following a link to open a work item that no longer existed in the database. I caught it in time to make a screenshot and circulate to everyone in the office before moving on with my work.

Happy Halloween, everyone! =D

In other news, I’m being asked to look over the Japanese translation of Radiant again, which I will find some time to do in the next week or so. I think I’ve found a new place to record my podcast so I’m looking forward to producing episodes of The Japanese Learner again early in November.

LDAP Pass-through Authentication with Authlogic and ActiveLdap


Today, I pushed a branch to my fork of authlogic_example: with-activeldap.

This branch shows a way of implementing pass-through authentication to an LDAP server using ActiveLdap and Authlogic, with just some small changes to the User and UserSession models.

Read the rest of this entry »

A Rails Puzzler


While I refuse to call this “magic”, the following has been confusing me for a long time now and I’ve finally decided to post it to my blog and see if anyone else gets it.

It turns out that ActiveScaffold and YARD don’t play nice together. In particular, if YARD has previously been loaded (say, to define a Rake task for it), ActiveScaffold initialization will fail with the following error:

uninitialized constant Helpers::ControllerHelpers

Using --trace and following the source code, I find out that this is happening during ActiveScaffold’s initialization, particularly at this statement:

ActionController::Base.send(:include, ActiveScaffold::Helpers::ControllerHelpers)

Debugging the ActiveScaffold initialization code yields this baffling result:

>> ActiveScaffold::Helpers
=> Helpers
>> ActiveScaffold::Helpers::ControllerHelpers
NameError: uninitialized constant ActiveScaffold::Helpers

It’s the weirdest thing that I’ve seen since I became a Rubyist and it is blocking me from using YARD to generate the documentation for my current Rails project. Unfortunately, cutting out ActiveScaffold isn’t going to fly because the deadline for initial release is so close and so much functionality is implemented using it already. It wasn’t my choice; if I had my way, I might never use ActiveScaffold ever again.

On “Magical” Ruby and Rails


Giles Bowkett wrote a post which, at the surface, seems to be a harsh criticism of the way that Pythonistas and, in particular, Django developers view Ruby and Rails but is actually much more general — he simply wanted to point out that the entire notion of calling language/framework features “magic” is silly for programmers, who should prefer to be rational than superstitious.

Read the rest of this entry »

GitHub Project Watch – 09/07/08


I’ve decided to create a new series of posts called “GitHub Project Watch” to highlight some of the projects on GitHub that I am watching. It’s kind of like GitHub Rebase, but with my own personal touch.

Here are some of the projects that I’m watching this week:

  • jmettraux/ruote: an open source workflow engine built with Ruby. I might be using this for a project I’m working on. Also see jmettraux/ruote-web2 for a demonstration of how to integrate ruote with Ruby on Rails.
  • brynary/webrat: automated acceptance testing with Ruby. It can simulate a simple browser on its own or drive a real browser via Selenium. Apparently there’s some work in progress on integrating with Watir and Celerity as well.
  • radiant/radiant: RadiantCMS, the lightweight web content management system for Ruby on Rails. I’m contributing a Japanese translation, the current version of which is currently available in the official i18n branch. (also see kbingman/radiant and enricob/radiant)
  • chriseppstein/compass: As I wrote previously, Compass is gaining new features at an incredible rate. It now sports improved Rails integration, Blueprint 0.9, an extension system, and asset hosts support. As an added bonus, it no longer depends on edge Haml; it will work with the newest stable release of Haml, 2.2.0. This is one of the most watched repositories on GitHub for a reason — if you’re not already using this, try it today!

I’m sure that I will hear of even more awesome projects at Future Ruby.

Radiant CMS in Japanese

(Japan, Programming)

Recently, I started a project to translate Radiant CMS into Japanese.  I started with Keith Bingman’s Radiant fork and added a Japanese message bundle.  Since then, Hirotaka Mizutani has been offering his help with the translation as well.