开发者

Is it possible to use sessions on html.erb file on rails 2.3.8?

开发者 https://www.devze.com 2023-04-05 20:34 出处:网络
Is it possible to use sessions on html.erb file? If so please can someone explain how to use session variables on html.erb files ?? I have session[:id] on my controll开发者_如何学Pythoner and I need t

Is it possible to use sessions on html.erb file? If so please can someone explain how to use session variables on html.erb files ?? I have session[:id] on my controll开发者_如何学Pythoner and I need to get that id on my html.erb so how can I do that please give me a solution for this problem. Thanks


Place this in your view: <%= session[:id] %>

<%= ... %> will evaluate any statement available to the view_context.

The = sign after the % is very important because is evaluating the expression,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号