Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Commit

Permalink
be more fault tolerant with nil values in habtm_check_boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron committed Nov 4, 2011
1 parent 1740d9e commit 6055f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/composable_builders/components/tagged.rb
Expand Up @@ -145,7 +145,7 @@ def build_radio_button(method, name, value = 0, checked = false)
def build_habtm_check_box(method, name, value)
@template.content_tag(:li,
@template.hidden_field_tag(habtm_tag_name(method), nil) +
@template.check_box_tag(habtm_tag_name(method), value, @object.send(method).include?(value)) + name.to_s
@template.check_box_tag(habtm_tag_name(method), value, @object.send(method).try(:include?, value)) + name.to_s
)
end

Expand Down

0 comments on commit 6055f7a

Please sign in to comment.