forked from bofh/fetsite
AutoCommit Sam Aug 1 12:03:01 CEST 2015
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user