Active_admin undefined method 'patch'. Conflict with routes.rb
-
19-10-2022 - |
题
I am using ruby-2.1.1, gem the_role and active_admin
When I am trying to install active_admin, using
rails generate active_admin:install
I have got the following error:
.../config/routes.rb:25:in `block (3 levels) in <top (required)>': undefined
method `patch' for ActionDispatch::Routing::Mapper:0x000000073516d0 (NoMethodError)
here is code in my routes.rb
namespace :api, defaults: {format: 'json'} do
scope module: :v1, constraints: ApiConstraints.new(version: 1) do
resources :leads
end
scope module: :v2, constraints: ApiConstraints.new(version: 2, default: true) do
resources :leads
patch '/leads/update' => 'leads_controller#update', as: 'update_leads'
end
end
If i replace patch => put, I have got another error, in gem the_role:
.../.rvm/gems/ruby-2.1.1/gems/the_role-2.3/config/routes.rb:4:in `block (3 levels)
in <top (required)>': undefined method `patch'
for #<ActionDispatch::Routing::Mapper:0x0000000850e990> (NoMethodError)
How can I install Active_admin? Thanks in advance!
没有正确的解决方案
不隶属于 StackOverflow