0

I'm using the link to delete the record below is the code that I have used

<%= link_to product, method: :delete, data: { confirm: 'Are you sure?' }%>

when I click on the click alert box will open with the values "ok" to proceed and "Canel" to reject. So my question how do I change the "ok" to "Yes" and "cancel" to "reject" in the alert box. Below is the image for the reference

enter image description here

Rahul
  • 170
  • 1
  • 3
  • 14
  • 5
    https://stackoverflow.com/a/1800059/297087 – Salil Aug 26 '20 at 07:07
  • 2
    This is native browser behaviour. You have no control how it looks on different devices/browsers. If you want totally custom control for the dialogue box, you need to implement it yourself instead. – Tom Lord Aug 26 '20 at 11:02
  • It's like asking "how do I change a native datepicker?", or "how do I change a native number-field input behaviour?". You should either embrace it, or not use it at all. **For example**, the built-in browser behaviour will take into account the user's language settings, and will behave differently on mobile vs desktop. – Tom Lord Aug 26 '20 at 11:06
  • By the way, your image is quite confusing. If the default buttons are "Yes"/"Cancel", and you want to change this to "OK"/"Reject", then why did you show us a half-changed version of "OK"/"Cancel"? – Tom Lord Aug 26 '20 at 11:07
  • @TomLord that first comment is pretty much an answer to the question. – max Aug 26 '20 at 12:17
  • @TomLord sorry man I have updated the question.. and your first comment - I was not aware of that... so basically I wanted fully customize alert box now I switched to sweet alert – Rahul Aug 27 '20 at 17:50

0 Answers0