Topic: Display details of current logged in user.
How do you display details such as user name, e-mail, first name of ONLY CURRENTLY logged in user.
The following code display screen name of every user registered (which I don't want) __________________________________________________________________________________________________
app/controllers/user_controller.rb - index action
def index
@users = User.find(:all)
end
__________________________________________________________________________________________________
app/views/user/index.html.erb
<h1>Users</h1>
<ol>
<% @users.each do |user| %>
<li><%= user.screen_name %></li>
<% end %>
</ol>
__________________________________________________________________________________________________
I've searched books, websites but always been unsuccessful.
I would really appreciate your help.
Thanks,