Module: GearsHelper

Defined in:
app/helpers/gears_helper.rb

Overview

Helper for displaying Gears

Instance Method Summary collapse

Instance Method Details

#gear_display_tags(gear) ⇒ Object


5
6
7
8
9
10
11
12
# File 'app/helpers/gears_helper.rb', line 5

def gear_display_tags(gear)
  gear_tags = []
  gear_tags << "#{gear.harm}-harm" if gear.harm.to_i.positive?
  gear_tags << "#{gear.armor}-armor" if gear.armor.to_i.positive?
  gear_tags += gear.tag_list
  return '' if gear_tags.empty?
  "(#{gear_tags.join(' ')})"
end

14
15
16
# File 'app/helpers/gears_helper.rb', line 14

def link_to_gear(gear)
  gear ? link_to(gear.name, gear) : ''
end