I currently have a rails check_box_tag call that looks like
check_box_tag #{name}
I want to include a checked attribute, which I know I can do
There are no ways to do it directly. But the check_box_tag
implementation is trivial, you can monkey patch it or create own helper.
Original implementation:
def check_box_tag(name, value = "1", checked = false, options = {})
html_options = { "type" => "checkbox", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
html_options["checked"] = "checked" if checked
tag :input, html_options
end