【问题标题】:What is the different between ::Rails::Engine and Rails::Engine [duplicate]::Rails::Engine 和 Rails::Engine 有什么区别 [重复]
【发布时间】:2013-01-03 15:52:23
【问题描述】:

可能重复:
Ruby’s double colon (::) operator usage differences

我为 Rails 创建了一个font-awesome pluginlib/rails-font-awesome.rb

module Rails
  module Font
    module Awesome
      class Engine < ::Rails::Engine
      end
    end
  end
end

我可以改用 Rails::Engine 吗?

【问题讨论】:

  • @atmaish 对不起,我没有足够的搜索。

标签: ruby-on-rails ruby


【解决方案1】:

::Rails 之前的Rails 告诉它跳过正常遍历层次结构以查找类并直接进入顶部。

【讨论】:

    猜你喜欢
    • 2016-08-23
    • 2019-03-05
    • 2017-04-07
    • 2017-12-19
    • 2016-12-31
    • 1970-01-01
    • 2010-12-28
    • 1970-01-01
    • 2018-09-02
    相关资源
    最近更新 更多