Module: ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Overview

Methods added to this helper will be available to all templates in the application.

Instance Method Summary collapse

Instance Method Details

#object_name(oiw) ⇒ Object

Affiche proprement le nom d’un object in world ou bien “none”

XXX Ce helper n’est plus utilisé, on peut sans doute le supprimer.

Input

oiw

ObjectInWorld

Output

Affiche le nom, échappé avec “h()”, ou bien le mot “none



15
16
17
# File 'app/helpers/application_helper.rb', line 15

def object_name(oiw)
  oiw ? h(oiw.name) : "none"
end

#object_url(oow) ⇒ Object

Affiche proprement l’url d’un ObjectOffWorld

Input

oow

ObjectOffWorld

Output

Affiche le nom, avec un lien hypertexte, ou bien le mot “none



28
29
30
# File 'app/helpers/application_helper.rb', line 28

def object_url(oow)
  oow ? "<a href=\"#{oow.content}\">#{oow.name}</a>" : "none"
end