Hi,
Rails 2.3.3 + restful_authentication.
current_user is a method from lib/authenticated_system.rb through
“include AuthenticatedSystem” in application_controller.rb
-------- home/_current_user.pl.html.erb : --------
<% if current_user %>
NOT NIL
<% else %>
NIL
<% end %>
-------- home/_user_box.pl.html.erb : --------
<% if current_user %>
NOT NIL
<% else %>
NIL
<% end %>
-------- layouts/layout.html.erb : --------
<%= render :partial => ‘/home/current_user’ -%>
<%= render :partial => ‘/home/user_box’ %>
----- OUTPUT: -------
NIL
NOT NIL
---- LOGS: -------
[INFO : 0925 13:43:58 #9238] Rendering template within layouts/layout
[INFO : 0925 13:43:58 #9238] Rendering home/index
[DEBUG: 0925 13:43:58 #9238] Rendered home/_current_user.pl (0.2ms)
[DEBUG: 0925 13:43:58 #9238] User Columns (1.9ms) SHOW FIELDS FROM
users
[DEBUG: 0925 13:43:58 #9238] User Load (0.2ms) SELECT * FROM users
WHERE (users
.id
= 1) LIMIT 1
[DEBUG: 0925 13:43:58 #9238] Rendered home/_user_box.pl (6.9ms)
[INFO : 0925 13:43:58 #9238] Completed in 16ms (View: 8, DB: 2) | 200 OK
[http://localhost/]
Why is that so? Why one time it is nil and the other time it is not nil?
Any help appreciated.
Regards.