“装载"是什么? Rails路由中的指令意思是什么? [英] What does the "mount" instruction mean in Rails routing?
本文介绍了“装载"是什么? Rails路由中的指令意思是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在铁路网路由系统.
我已设置 Mercury 在我的Rails应用程序中使用.它将这一行添加到我的routes.rb
配置文件中:
I have set up Mercury to use within my Rails application. It added this line to my routes.rb
config file:
Appname::Application.routes.draw do
mount Mercury::Engine => '/'
mount
关键字是什么意思?
What does the mount
keyword mean?
推荐答案
安装相当于Unix mount
.
它实际上告诉应用程序该位置存在另一个应用程序(通常是 Rack 应用程序).
Mount within the Rails routes does the equivalent of a Unix mount
.
It actually tells the app that another application (usually a Rack application) exists on that location.
它主要用于Rails引擎.
It is used mostly for Rails Engines.
这篇关于“装载"是什么? Rails路由中的指令意思是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文