h1

http_authentication plugin with Rails 2.1

July 17, 2008

If you’re using the popular http_authentication plugin from DHH and getting a NoMethod error “protected method `render’ called for <SomeController>”, the problem is that in Rails 2.x controller.render is now protected.  This was a pain to figure out, but it can be easily solved using an updated plugin from Matthew Rudy at http://github.com/matthewrudy/http_authentication/tree/master.  Google wasn’t much help, so I’m hoping this post will save someone with this issue some time.  Just run

script/plugin install git://github.com/matthewrudy/http_authentication.git –force

and you should be fine after that.  The README in the plugin’s folder has further examples on use.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.