Module: ModsHelper

Defined in:
lib/six-updater-web/app/helpers/mods_helper.rb

Instance Method Summary collapse

Instance Method Details

#remote_column(record, b = nil) ⇒ Object



2
3
4
# File 'lib/six-updater-web/app/helpers/mods_helper.rb', line 2

def remote_column(record, b = nil)
  link_to "nfo", "http://stats.six-updater.net/#{record.rema}/#{record.id}", :target => "_blank"
end

#size_column(record, b = nil) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/six-updater-web/app/helpers/mods_helper.rb', line 5

def size_column(record, b = nil)
  if record.size
    "%0.2f MB" % (record.size / 1024.0)
  else
    0
  end
end

#type_column(record, b = nil) ⇒ Object



13
14
15
# File 'lib/six-updater-web/app/helpers/mods_helper.rb', line 13

def type_column(record, b = nil)
  record.class.label
end

#type_form_column(record, t, options) ⇒ Object



17
18
19
# File 'lib/six-updater-web/app/helpers/mods_helper.rb', line 17

def type_form_column(record, t, options)
  collection_select(:record, :type, ["RvMod", "Rv2Mod", "Rv3Mod", "Arma2Mod", "Arma2CaMod", "Arma2StMod", "Arma2OaMod", "Arma2OaStMod", "Arma2OaCoMod"], :to_s, :to_s, {:name => options[:name]})
end