Skip to content

How To: Sign in from a controller

betternow edited this page Jun 5, 2011 · 1 revision

Often (like, when creating users as part of another controllers create method) you want to sign in the user from a controller. This is how it is accomplished:

sign_in(:user, User.find(params[:id]))

Of course you could also just pass in a predefined User object.

Clone this wiki locally