LoginGenerator: show content only if logged in

n00b to rails here, working on my first project...i have LoginGenerator up and running, and i would like it to display certain site content only when logged in...something like...:

<% if logged_in -%> <a href="#" title="admin">Admin section</a> <% end -%>

has anybody done this with LoginGenerator?..any help is appreciated....

A small syntax correction, but using @session is discouraged now, since it is accessing the session variable directly. Just using session[‘user’].nil? is the preferred way, since it uses the session method (which right now only wraps the variable, but in the future could potentially do other things).

Hope that helps, Tyler Prete

thanks for info guys, its much appreciated...i did get it to work using this, as this is for a blog and there will only be one admin user...seems pretty similiar to your solution, Jon...:

<code> <% if @session['user'].blank? %> not logged in   <% else %> logged in, welcome! <% end %> </code>

tyler, thanks for info on @session....