Rails 3 - How can you get access to current_user in the IRB console?

I’m doing some design/debugging in IRB and need to login a user and then
able to gain access to current_user in my efforts (I’m using Devise for

I found a sequence from SO that allows me to successfully login via IRB
access a page response:

ApplicationController.allow_forgery_protection = false
app.post(’/sign_in’, {“user”=>{“login”=>“some-login-id”,

app.get ‘/some_other_path_that_only_works_if_logged_in’
pp app.response.body

I’ve been able to get session info:

=> {"_csrf_token"=>“1yAn0jI4VWzUH84PNTH0lVhjpY98e9echQGS4=”,

I’ve tried everything I can think of to try to get to current_user via
and app.session, but no luck. How can I access current_user?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs