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…:
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).
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…:
<% if @session['user'].blank? %>
not logged in
<% else %>
logged in, welcome!
<% end %>
tyler, thanks for info on @session…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.