需要哪些基本设置来确保路由 url 名称助手工作?
例如,在我的路线中,我有以下内容:
Blog::Application.routes.draw do
resources :news, :as => :news_items, :controller => :news_items, :only => [:show, :index]
scope :module => "refinery" do
scope(:path => 'refinery', :as => 'admin', :module => 'Admin') do
resources :news, :except => :show, :as => :news_items, :controller => :news_items
end
end
end
但以下似乎不起作用:
new_refinery_news_url
我不断收到错误
未定义的局部变量或方法`new_refinery_news_url'
所以我很确定我配置我的应用程序的方式缺少一些东西,谁的主要路由在 Gemfile 中添加的 RefineryCMS gem 中。
有什么想法吗?