On 06 Jul 2010, at 18:09, Lille wrote:

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.

Sure, but inline javascript like that is just a horrible thing :-)


Best regards

Peter De Berdt

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to