Forum: Ruby on Rails odd behavior with acts_as_authenticated

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-06-03 23:40
(Received via mailing list)
following the instructions on
 http://wiki.rubyonrails.com/rails/pages/Acts_as_au...

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:

<h1>User home page.</h1>

<% if logged_in? %>
  you are logged in
  <br>
  your email: <% current_user.email %>
  <br>
    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.
Rick O. (Guest)
on 2007-06-04 04:14
(Received via mailing list)
> 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://weblog.techno-weenie.net
http://mephistoblog.com
This topic is locked and can not be replied to.