开发者

Global Variables in Rails3 [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Where to put Global variables in Rails 3

Is it possible to set Site-Wide Global Variables in Ruby开发者_高级运维 on Rails?


It is bad practice

$my_global_var = "I am very bad variable!"
  • http://www.rubyist.net/~slagell/ruby/globalvars.html
  • http://rubylearning.com/satishtalim/ruby_summary2.html


You can use general Ruby syntax $var_name, but I don't know any case when global variable is a best approach.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜