Over a million developers have joined DZone.

Ajax Link Call To Function With Image As Icon

DZone's Guide to

Ajax Link Call To Function With Image As Icon

Free Resource
// 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 })

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}