Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created October 10, 2011 19:04
Show Gist options
  • Select an option

  • Save patmaddox/1276205 to your computer and use it in GitHub Desktop.

Select an option

Save patmaddox/1276205 to your computer and use it in GitHub Desktop.
A little helper to allow logging in via URL param
class ApplicationController < ActionController::Base
def login_as_user_param
return unless Rails.env.development? || Rails.env.test?
sign_in(User.find(params['_current_user'])) if params['_current_user']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment