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


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

查看所有标签

猜你喜欢:

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

Uberland

Uberland

Alex Rosenblat / University of California Press / 2018-11-19 / GBP 21.00

Silicon Valley technology is transforming the way we work, and Uber is leading the charge. An American startup that promised to deliver entrepreneurship for the masses through its technology, Uber ins......一起来看看 《Uberland》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具