Fixing the warden and rails3 TypeError (can’t convert nil into String) error

I’ve upgraded an app I run that uses warden to Rails3. I started getting “TypeError (can’t convert nil into String)” exceptions after the upgrade:

I tracked it down to the action name not getting set, so I added this in my Warden::Manager.before_failure block:

env['action_dispatch.request.path_parameters'][:action] = "login"

The complete block now:

There may be a better way of doing this, but it works for me.

Tagged ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s