# Odd behavior with acts\_as\_authenticated

**URL:** <https://www.ruby-forum.com/t/odd-behavior-with-acts-as-authenticated/105856>\
**Category:** Rails\
**Created:** [June 3, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/odd-behavior-with-acts-as-authenticated/105856 "2007-06-03T21:40:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 3, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/odd-behavior-with-acts-as-authenticated/105856/1 "2007-06-03T21:40:57Z")

</div>

following the instructions on  
[Peak Obsession](http://wiki.rubyonrails.com/rails/pages/Acts_as_authenticated)

I got it all working, except I can’t see how to make my currently  
logged in user’s info appear on the /account/index page.

I replaced the poem that comes default from the generator in /account/  
index.rhtml with:

# User home page.

\<% if logged\_in? %\>  
you are logged in  
  
  
your email: \<% current\_user.email %\>  
  
  
your login: \<% current\_user.login %\>  
\<% else %\>  
you are not logged in  
\<% end %\>

This WORKS to show me if the user is logged in or now (so I guess the  
logged\_in? is ok), but for some reason \<% current\_user.email %\> and \<%  
current\_user.login %\> both come out blank even though I can see data  
in the database for the currently logged in user.

Maybe I got the syntax wrong or something? Wondering how to make this  
work. thanks.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 4, 2007, 2:14am UTC](https://www.ruby-forum.com/t/odd-behavior-with-acts-as-authenticated/105856/2 "2007-06-04T02:14:19Z")

</div>

> This WORKS to show me if the user is logged in or now (so I guess the  
> logged\_in? is ok), but for some reason \<% current\_user.email %\> and \<%  
> current\_user.login %\> both come out blank even though I can see data  
> in the database for the currently logged in user.
> 
> Maybe I got the syntax wrong or something? Wondering how to make this  
> work. thanks.

Use \<%= if you want to actually output the data. This has nothing to  
do with acts\_as\_authenticated.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
