From: balcer Date: 2005-09-12T20:16:36+09:00 Subject: Re: RoR sessions Ken Fettig napisa�(a): > Hello, how do I access session values from a view in Rails? I have tried <%= > #{@session[:user].userid'} but this causes a Rails error when it tries to > render the View. How do I code this correctly? > > Thanks much > Ken > kenfettig@btinet.net > > I have no becouse I'am at work now and can not check it. 1) all code that is between <% %> is just a ruby code so <%=session[:user].userid%> would be better idea 2) #{@session[:user].userid' - what is ' on the end of line - this for sure will give you and error 3) #{some_value} this one you use only inside string so <% years=10 %>

#{years.to_s}

Cheers, Jacek P.S. I see that you should read a little bit more about eruby.