活动管理员操作的自定义路由? [英] Custom route for activeadmin actions?
本文介绍了活动管理员操作的自定义路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在用activeadmin创建一个页面来更新当前用户的密码。我有一个非持久性模型来检查密码等的验证。我的问题是,当我尝试
I'm making a page with activeadmin to update password of current user. I have a non-persisted model to check validation of password, etc. My problem is that when I try
ActiveAdmin.register UpdatePassword do
actions :edit, :update
end
它会创建路线/
我想通过获取和放置将这些路由更改为/ update_passwords。
I want to change those routes to /update_passwords via get and put.
有什么办法可以改变它?
Is there any way to change that?
推荐答案
我找不到解决办法使用activeadmin,但定义了手动工作的路由:
I couldn't find a way to do it with activeadmin but defining the routes manually worked:
#config/routes.rb
match "/admin/update_passwords" => 'admin/update_passwords#edit', via: :get, as: "admin_update_passwords"
match "/admin/update_passwords" => 'admin/update_passwords#update', via: :post
这篇关于活动管理员操作的自定义路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文