How To: Sign in from a controller - heartcombo/devise GitHub Wiki
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.find(params[:id]), scope: :user)
Of course you could also just pass in a predefined User object.