开发者

Global Variables in Rails3 [duplicate]

开发者 https://www.devze.com 2023-02-21 17:40 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Where to put Global variables in Rails 3
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

精彩评论

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