# Weird user/login engine behaviour

**URL:** <https://www.ruby-forum.com/t/weird-user-login-engine-behaviour/52982>\
**Category:** Engines Development\
**Created:** [January 22, 2006, 5:03pm UTC](https://www.ruby-forum.com/t/weird-user-login-engine-behaviour/52982 "2006-01-22T17:03:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [January 22, 2006, 5:03pm UTC](https://www.ruby-forum.com/t/weird-user-login-engine-behaviour/52982/1 "2006-01-22T17:03:48Z")

</div>

Hi all, have a weird issue going on. I have something like the  
following to check out the current user information:  
\<%= “#{current\_user.id} / #{post.user.id}” %\>  
This is in a partial that gets rendered as a collection. The odd thing  
is that in every rendering the ids always show up the same, and to top  
that off, the link\_if\_authorized is also using the poster id (or so it  
seems) and renders the link if the original poster can do to the  
action.

Example. I’m logged in as a normal user. The first post was made by an  
admin and have 2 replies by the normal user. In the partial I have \<%=  
link\_if\_authorized “Move”, :controller =\> “post”, :action =\> “move” %\>  
where the action is limited to admins only. When the posts are  
rendered, the move link gets rendered on the first post only, and none  
of the others.

I also have \<% if session[:user] and session[:user].id = post.user.id  
%\> which is followed by an edit link, which gets rendered for all the  
posts, even though I’m not logged in as the admin or creator of the  
first post.

Any ideas?! I’ve looked for where else the session[:user] might get  
set, but can’t find it anywhere. I haven’t modified the 2 engines at  
all, so I’m not sure whats going on!

Any help would be appreciated!

-Nick "thoroughly confused’ S

---

<div class="post-metadata">

**Author:** ![nicksnels](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@nicksnels](https://www.ruby-forum.com/u/nicksnels)\
**Post date:** [January 22, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/weird-user-login-engine-behaviour/52982/2 "2006-01-22T17:16:00Z")

</div>

Hah, never mind…silly single =  
Bad equals sign! bad!

_goes and stands in the corner_
