Skip to content

Instantly share code, notes, and snippets.

@kirkconnell
Created May 2, 2011 16:33
Show Gist options
  • Save kirkconnell/951884 to your computer and use it in GitHub Desktop.
Save kirkconnell/951884 to your computer and use it in GitHub Desktop.
#return an array of arrays for the act event logger track changes in content_ui fields
# [ profile content real name, "displayed field name: displayed field value"]
def content_x_log_array
content_ui_log_instructions = (1..20).map {|n| ["content_#{n}", lambda{|value| "#{get_display_name(n)} : #{value}" }}
end
def get_display_name(n)
if template_group.present? && ci = template_group.content_uis.find{|ci| c.generic_field_number == n}
ci.field_name.titleize.gsub(/\s+/, '').underscore.to_sym
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment