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
It creates the routes /update_passwords/:id and /update_passwords/:id/edit.
I want to change those routes to /update_passwords via get and put.
Is there any way to change that?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With