What I want to do:
use HTTP Basic Authentication (stop screaming!) and then redirect to a
What I am trying to do:
Use a before filter which will authenticate and then redirect to the
How I am failing (It's a little ugly, but please bear with me - I'm
trying to understand how this works):
class ApplicationController < ActionController::Base
authenticate_or_request_with_http_basic do |username, password|
user = User.first(:conditions => ['username like ? and password
like ?', username, password])
redirect_to root_path and return unless user.nil?
How it is failing:
It tells me there's a render and a redirect.
Can anyone suggest something here? Am I just .. Thinking about it the