Sha256: 17cbf5ab00ae6ff2573aaa06f8eee0a7202caacde8361934fda5eef41a52e56b
Contents?: true
Size: 1 KB
Versions: 13
Compression:
Stored size: 1 KB
Contents
module Ludy # check box helper for html view generation. # require 'ludy/helpers/check_box' # module ApplicationHelper # include Ludy::CheckBox # end module CheckBox # create a link respond to onclick and <em>check</em> all check_box for all # specified elements. # id_and_or_class, e.g., #form_inviting input.check_box_friend # ^^^^^id elements^^^ ^^^^^^^^^^^class def check_all text, id_and_or_class "<a href=\"#\" onclick=\"$$('#{id_and_or_class}').each(function(box){box.checked='checked'});return false;\">#{text}</a>" end # create a link respond to onclick and <em>uncheck</em> all check_box for all # specified elements. # id_and_or_class, e.g., #form_inviting input.check_box_friend # ^^^^^id elements^^^ ^^^^^^^^^^^class def uncheck_all text, id_and_or_class "<a href=\"#\" onclick=\"$$('#{id_and_or_class}').each(function(box){box.checked=''});return false;\">#{text}</a>" end end end
Version data entries
13 entries across 13 versions & 2 rubygems