草庐IT

UrlGenerationError

全部标签

ruby-on-rails - 将范围添加到 ActiveAdmin 路由获取 ActionController::UrlGenerationError

我正在尝试向ActiveAdmin路由添加一个范围,以便我可以在URL中包含“/:brand”。所以不是localhost:3000/admin/dashboard而是localhost:3000/bg/admin/dashboard,bg是品牌。我的routes.rb设置如下:Rails.application.routes.drawdoscope'/:brand',brand:/bg|gwt|acf/dodevise_for:admin_users,ActiveAdmin::Devise.configActiveAdmin.routes(self)endend用于登录http://

ruby-on-rails - ActionController::UrlGenerationError 缺少必需的键:[:id]

我是ruby​​的新手-尝试使用rails并且我已经尝试做一个简单的注册表单:这是一个错误:Noroutematches{:action=>"show",:controller=>"user"}missingrequiredkeys:[:id]谁能解释一下这到底是什么意思?编辑:我正在学习本教程,仅将帖子更改为用户:http://guides.rubyonrails.org/getting_started.html 最佳答案 form_for应该总是得到一个对象..就像来自Controller的用户#controllerdefnew

ruby-on-rails - 文章中的 ActionController::UrlGenerationError#edit

我收到以下错误:没有路由匹配{:action=>"show",:controller=>"articles",:id=>nil}缺少必需的键:[:id]以下是显示错误的代码。这是什么错误,每当我从上一个屏幕点击编辑时,我想我正在发送文章ID。这是我的rake路由输出PrefixVerbURIPatternController#Actionwelcome_indexGET/welcome/index(.:format)welcome#indexarticlesGET/articles(.:format)articles#indexPOST/articles(.:format)articl

ruby-on-rails - Rails 指南第 5.12 节的 UrlGenerationError

我正在学习位于此处的Rails4.0.0入门教程:http://guides.rubyonrails.org/getting_started.html#updating-posts当我尝试从主页(localhost)导航到localhost/posts时,出现此错误:ActionController::UrlGenerationErrorinPosts#indexShowingC:/RailsInstaller/blog/app/views/posts/index.html.erbwhereline#16raised:Noroutematches{:action=>"show",:co