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