English 中文(简体)
铁路3号发动机
原标题:Mounting Rails 3 Engines

我创建了一个名为“铁路3”的发动机。 在我的发动机内,我有意见,但载于<代码>app/views/engine_name/code>。

当我把这一发动机投入我的项目时,我又在我的Gemfile上添加了gem发动机_name ,路上: /engine_name

现在,当我去我的现场时:3 000/engine_name/ Controller,我发现了一个错误,可以发现这种错误。 查阅<代码>/Users/shamoon/Sites/engine_name/app/views"而不是/Users/shamoon/Sites/engine_name/app/engine_name/views>

我如何确定这一点?

最佳回答

在途中,我说

  mount EngineName::Engine => "/path_to_engine", :as => "engine_name"
问题回答

暂无回答




相关问题
Ruby net-dns reverse lookups

I am trying to get reverse DNS lookups working with the net-dns gem for ruby. From the rdoc res = Net::DNS::Resolver.new ip = IPAddr.new("172.16.100.2") packet = res.search(ip) packet = res.search("...

How can I show updates with gem?

I want on my webserver a script that checks automatical over cron if there are gem updates without installing updates. I don t find anything about this task in the gem docs.

missing rake tasks?

I have ran gem install rails and am running 2.3.4 but i am missing some rake tasks like db and gems if i run rake -T i get the following tasks. How can i get all the others ? rake apache2 # ...

Ruby Daemons Gem

I installed the ruby gem Daemons. To make sure it was working I created a script that would print to a file every 5 seconds. I then created another file to run the script using the trivial example ...

Ruby gems repository

I m trying to set a gem repository on one of our local servers. Here are the steps I m running, that I ve followed from several guides. 1) I create the BASEDIR folder /var/www/html/gems 2) sudo cp -...

Search logic functionality

The functionality I m looking for: I have a form that will search my Proposal model. I want the form to contain a select box and display the categories I have. Now, category is merely a column in ...

Ruby Geolocation Gem/Plugins [closed]

What are the available (best) ruby IP-based geolocation gem/plugins? How do they compare to one another in terms of functionality, performance and ease of use (e.g. do they interact with a web ...

How do I find gems that depend on a given gem?

Is it possible to search for all gems that rely on a certain rubygem? For example, I d like to ask for all gems in gemcutter that rely on the test-unit gem. Background: I m looking to see how other ...