我已经在路由中得到了。rb
constraints SubdomainConstraint do
scope '/', controller: :hub_categories do
get '/', to: 'hub_categories#index'
get 'list', to: 'hub_categories#list'
post 'documents', to: 'hub_categories#create'
delete 'documents/:id', to: 'hub_categories#destroy'
get 'documents/:id/request', to: 'hub_categories#request'
get 'documents/:id/result', to: 'hub_categories#result'
get 'documents/:id/word', to: 'hub_categories#word'
end
root to: 'hub_categories#index'
end
在此约束之外,我有更多的路线,例如/documents
等。除了约束(包括,get 'documents'
(内的那些路线之外,我该如何匹配任何东西与'hub_categories#index'
?
我的所有尝试,例如约束块中的match '*', to: 'hub_categories#index', via: :all
,都会与此错误结束:
ruby/user/cdrum/.rvm/gems/ruby-2.5.0@aplus/bin/rspec(51938,0X7FFF9EE53340(malloc:*** object 0x7fef03d21210的错误:被释放后。 在malloc_error_break中设置一个断点
非主题更新
该错误是由于损坏的RVM安装而导致的,因此,如果您要进行运行rvm implode
,则重新安装RVM,然后是Ruby,然后您的宝石。
将其放在SubdomainConstraint
块的底部做到了:
get '*path', to: 'hub_categories#index'
Rails 5弃用match
,我的错误是由于损坏的RVM安装。