Never been to DZone Snippets before?

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

remote image submit tag (See related posts)

// do a remote_submit_tag but instade of simple input it makes a input type image

def remote_image_submit_tag(source,options)
    options[:with] ||= 'Form.serialize(this.form)'
    
    options[:html] ||= {}
    options[:html][:type] = 'image'
    options[:html][:onclick] = "#{remote_function(options)}; return false;"
    options[:html][:src] = image_path(source)
    
    tag("input", options[:html], false)
  end

You need to create an account or log in to post comments to this site.


Click here to browse all 4881 code snippets

Related Posts