link_to syntax with rails3 (link_to_remote) and basic javascript not working in a rails3 app?

Posted by z3cko on Stack Overflow See other posts from Stack Overflow or by z3cko
Published on 2010-03-16T23:10:57Z Indexed on 2010/03/19 19:11 UTC
Read the original article Hit count: 690

Filed under:
|
|

i am wondering if the basic link_to syntax is completely broken in current rails3 master or if i am doing some wrong syntax here.

= link_to "name", nil, :onlick => "alert('Hello world!');"

should actually produce an alert on click. very simple. does not work on my rails3 project! (also no error output!) any ideas?

for the general link_to syntax i could not find an example where i could combine a link_to_remote with a confirmation, remote and html class (see my try below)

= link_to "delete", {:action => "destroy", :remote => true, :method => :delete, :confirm => "#{a.title} wirklich Löschen?" }, :class => "trash"

even the rails3 api does not help me here: http://rails3api.s3.amazonaws.com/index.html

help!

© Stack Overflow or respective owner

Related posts about rails3

Related posts about link-to