lundi 9 décembre 2019

No route matches [GET] “/admin/orders/197/update” if i change method like put or patch it still gives same error with the method name i put there

orders.rb

if order.payment_status == 'Paid' && order.received_by_admin != 'true'
        link_to "Payment Not Recieved", "orders/#{order.id}/update?payment_status=paid" , class: "member_link"

and this is in update function

if params[:payment_status].present?
  order.update!(received_by_admin: true)
end

this is in route file

resources :orders
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  mount_devise_token_auth_for 'User', at: 'auth'

Aucun commentaire:

Enregistrer un commentaire