Last active
August 29, 2015 14:12
-
-
Save kennethgeerts/3229205cb74a302b0e52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def document_actions_form_tag | |
capture do | |
concat form_tag('', method: :post, id: 'document_actions_form') | |
input_name_value_pairs(request.params).each do |name_value_pair| | |
concat tag('input', { name: name_value_pair.first, value: name_value_pair.last, type: 'hidden' }) | |
end | |
clazz = Class.new do | |
def checkbox_header | |
"<input type=\"checkbox\" id=\"select-all\" />".html_safe | |
end | |
def checkbox(document_id) | |
"<input name=\"selected[#{document_id}]\" type=\"checkbox\" class=\"cb\" />".html_safe | |
end | |
end | |
yield clazz.new | |
concat '</form>'.html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment