【发布时间】:2011-11-30 04:55:58
【问题描述】:
需要哪些基本设置才能确保路由 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 中。
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails routing refinerycms