It's just a ruby string, confirm has nothing to do with it, are you sure you have double quotes in your actual code? It's not interpolating which is what happens when you have single quotes.
Using variables in link_to :confirm
-
09-03-2022 - |
Question
I want to use variables in the confirm
message in link_to
<%= link_to 'DESTROY!', @user, :confirm => "are you sure you want to delete #{@user.name}"%>
this doesn't seem to work and it prints "are you sure you want to delete #{@user.name}"
How do I use variables in the confirm message?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow