Link_to_function

Hello

I wonder why this happens:

this:

<%= link_to_function image_tag(“chart_bar.png”), :onclick=>“new
Effect.toggle(‘bar-project#{project.id}’)” %>

outputs this:

a href="#" onclick=“onclicknew Effect.toggle(‘bar-project188’); return
false;”>Chart_bar

the link_to_funtions returns twice onclick hence it will not work.
please help

<%= link_to_function image_tag(“chart_bar.png”), :onclick=>“new
Effect.toggle(‘bar-project#{project.id}’)” %>

I think you want this instead:

<%= link_to_function image_tag(“chart_bar.png”), “new
Effect.toggle(‘bar-project#{project.id}’)” %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs