Sha256: 5b3597385ea6d80b8a4d74a2170bbd4b95c88417146734bc56a74abe00f8af07

Contents?: true

Size: 362 Bytes

Versions: 35

Compression:

Stored size: 362 Bytes

Contents

def checked?
  content == "1"
end

view :core do
  case card.content.to_i
  when 1 then tr(:yes)
  when 0 then tr(:no)
  else
    "?"
  end
end

format :html do
  view :editor do
    toggle
  end

  view :labeled_editor do
    toggle + toggle_label
  end

  def toggle
    check_box :content
  end

  def toggle_label
    label :content, card.name.tag
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
card-1.98.3 mod/standard/set/type/toggle.rb
card-1.98.2 mod/standard/set/type/toggle.rb
card-1.98.1 mod/standard/set/type/toggle.rb
card-1.98.0 mod/standard/set/type/toggle.rb
card-1.97.0.1 mod/standard/set/type/toggle.rb
card-1.97.0 mod/standard/set/type/toggle.rb
card-1.96.8 mod/standard/set/type/toggle.rb
card-1.96.7 mod/standard/set/type/toggle.rb
card-1.96.6 mod/standard/set/type/toggle.rb
card-1.96.5 mod/standard/set/type/toggle.rb
card-1.96.4 mod/standard/set/type/toggle.rb
card-1.96.3 mod/standard/set/type/toggle.rb
card-1.96.2 mod/standard/set/type/toggle.rb
card-1.96.1 mod/standard/set/type/toggle.rb
card-1.96.0 mod/standard/set/type/toggle.rb
card-1.95.3 mod/standard/set/type/toggle.rb
card-1.95.2 mod/standard/set/type/toggle.rb
card-1.95.1 mod/standard/set/type/toggle.rb
card-1.95.0 mod/standard/set/type/toggle.rb
card-1.94.1 mod/standard/set/type/toggle.rb