ruby-on-rails – 如何获取Rails 3应用程序中所有引擎的列表

栏目: Ruby · 发布时间: 7年前

内容简介:翻译自:https://stackoverflow.com/questions/5049640/how-to-get-the-list-of-all-engines-in-rails-3-app
根据Rails 2.x中的 Rails engines extending functionality

,可以做到

Rails::Initializer.new(Rails.configuration).plugin_loader.engines

此代码在Rails 3中不起作用

ActionController::RoutingError (undefined method `new' for Rails::Initializer:Module):
  config/application.rb:12:in `require_or_load'

在Rails 3中我需要做什么才能获得这样的引擎列表?

这是 Extending controllers of a Rails 3 Engine in the main app 所必需的

截至2011年10月10日和Rails 3.1测试版,它现在
Rails::Application::Railties.engines

翻译自:https://stackoverflow.com/questions/5049640/how-to-get-the-list-of-all-engines-in-rails-3-app


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Python for Data Analysis

Python for Data Analysis

Wes McKinney / O'Reilly Media / 2012-11-1 / USD 39.99

Finding great data analysts is difficult. Despite the explosive growth of data in industries ranging from manufacturing and retail to high technology, finance, and healthcare, learning and accessing d......一起来看看 《Python for Data Analysis》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具