DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Ajax Link Call To Function With Image As Icon

  • submit to reddit
        // 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 => })


John Griffiths replied on Mon, 2007/07/23 - 6:25am

excellent work!