Having come across the following: Routing “member_action” with activeadmin. I have followed active admin documentation for adding a customised action: Custom Action. My setup is as followed:
ActiveAdmin.register Charity do
index do
selectable_column
id_column
column :name
column :website
column :location
column :user_id
column :aasm_state
actions
end
filter :name
filter :location
filter :assm_state
member_action :approve, :method => :put do
Charity.find(params[:id])
redirect_to :back
end
action_item :approve, method: :put, only: :show do
link_to 'Approve', approve_admin_charity_path(params[:id])
end
controller do
def approve
puts "foo"
end
end
end
Routes.rb
approve_admin_charity PUT /admin/charities/:id/approve(.:format)
admin/charities#approve
error when i click the link below
Started GET "/admin/charities/33/approve" for 127.0.0.1 at 2015-06-21 03:29:09 -0400
ActionController::RoutingError (No route matches [GET] "/admin/charities/33/approve"):
Can anyone suggest what I maybe doing wrong here thanks
Aucun commentaire:
Enregistrer un commentaire