Over a million developers have joined DZone.

Ajax Link Call To Function With Image As Icon

// description of your code here
This railscode makes an ajaxcall to a action inside the controller and uses a image icon as the clickable area to trigger it. I am using it all over the place when doing nice looking admininterfaces.

link_to_remote (image_tag("/images/createchild.jpeg", :size => "17x17", :border => 0), 
:url => {:action => 'acton_inside_controller', :id => record.id })

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}