Forum: Rails Engines development Weird user/login engine behaviour

Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-01-22 17:03
(Received via mailing list)
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
Cb610750ee94ca103aef4b2dc7b1b768?d=identicon&s=25 Nick Stuart (Guest)
on 2006-01-22 17:16
(Received via mailing list)
Hah, never mind....silly single =
Bad equals sign! bad!

*goes and stands in the corner*
This topic is locked and can not be replied to.