Added creator_link and updator_link helpers

This commit is contained in:
Priit Tark 2015-03-23 11:17:27 +02:00
parent 15272bad76
commit d8d951974e
3 changed files with 24 additions and 7 deletions

View file

@ -17,4 +17,20 @@ module ApplicationHelper
"#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]"
end
end
def creator_link(model)
return 'not present' if model.blank?
return model if model.kind_of? String
# can be api user or some other user
link_to(model.creator, ['admin', model.creator])
end
def updator_link(model)
return 'not present' if model.blank?
return model if model.kind_of? String
# can be api user or some other user
link_to(model.creator, ['admin', model.updator])
end
end