AutoCommit Sam Aug 1 12:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-08-01 12:03:01 +02:00
parent a079a88dbc
commit 234880d90e
13 changed files with 78 additions and 61 deletions

View File

@@ -1,11 +1,14 @@
module PluginsHelper
def divid_for(object,suffix="")
if object.nil?
def divid_for(obj,suffix="")
if obj.nil?
""
else
object.class.to_s.to_lower.gsub("::","_")+ suffix.to_lower + object.id.to_s
obj.class.to_s.downcase.gsub("::","_")+ "_" + suffix.downcase + "_" + obj.id.to_s
end
end
def div_tag_for(o,&block)
content = capture(&block)
content_tag(:div, content, :id=>divid_for(o))
end
end
o