Best regards
Peter De Berdt
Actually, the matter is simpler than either of us seemed to
anticipate: the :confirm helper option just isn't very helpful. In
other words, all :confirm=>'Are you sure?' does is produce the raw
html onclick=>"return confirm('Are you sure?')". I had assumed that if
it were a helper, I should want to use it, not duplicate it, ergo my
post.
So, if anyone ever wants to make conditional the :confirm option of
the link_to/button_to erb function, use :onclick=>"if(...)
{ confirm('whatever text');}" -- involving whatever conditional logic
you like in the raw javascript.
And what are your plans if the user's browser isn't running
Javascript? Because in that case they won't ever see your
confirmation. Progressive Enhancement is better than Graceful
Degradation.
Bob