having trouble finding how to include a random chunk of javascript (an onclick event handler) in a link_to generated link. at first i thought i could use the html_options field, but if i understand correctly, that only supports :confirm, :popup, and :post options. hope i''m wrong. anyone know different? john _______________________________________________ John McGrath http://fryolator.com <http://fryolator.com/> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060126/477e0d11/attachment.html
John McGrath wrote:> having trouble finding how to include a random chunk of javascript (an > onclick event handler) in a link_to generated link. > > at first i thought i could use the html_options field, but if i > understand > correctly, that only supports :confirm, :popup, and :post options. > > hope i''m wrong. anyone know different? > > johnpretty much anything you put in the html options will show up in the html, except for those few exceptions. Just put "onclick"=>"random code" in and try it. _Kevin -- Posted via http://www.ruby-forum.com/.
worked, thanks much. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Kevin Olbrich Sent: Thursday, January 26, 2006 12:49 PM To: rails@lists.rubyonrails.org Subject: [Rails] Re: javascript in link_to? John McGrath wrote:> having trouble finding how to include a random chunk of javascript (an > onclick event handler) in a link_to generated link. > > at first i thought i could use the html_options field, but if i > understand > correctly, that only supports :confirm, :popup, and :post options. > > hope i''m wrong. anyone know different? > > johnpretty much anything you put in the html options will show up in the html, except for those few exceptions. Just put "onclick"=>"random code" in and try it. _Kevin -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails