Skip to content

Commit

Permalink
Fixed error with nil value on custom check_boxes field
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tillman committed Dec 13, 2011
1 parent 98400cf commit 2d8d71a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/views/fields/_group.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
%td
- if field.hint.present?
= image_tag "info_tiny.png", :title => field.hint, :class => "tooltip-icon"
- checked = YAML.load(f.object.send(field.name)) if field.as == 'check_boxes'
- if field.as == 'check_boxes'
- value = f.object.send(field.name)
- checked = YAML.load(value) if value
= f.input field.name, field.input_options.merge(:checked => checked)
- if i == 0
%td= spacer
6 changes: 3 additions & 3 deletions app/views/fields/_sidebar_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
%div
.caption #{field_group.label_i18n}
- field_group.custom_fields.each do |field|
- if asset.send(field.name).present?
== #{field.label}:<br /> <b>#{truncate(field.render_value(asset), :length => 35)}</b><br />
- if (value = field.render_value(asset)).present?
== #{field.label}:<br /> <b>#{truncate(value, :length => 35)}</b><br />

0 comments on commit 2d8d71a

Please sign in to comment.