Skip to content

Instantly share code, notes, and snippets.

@kirkconnell
Created April 29, 2011 23:55
Show Gist options
  • Save kirkconnell/949255 to your computer and use it in GitHub Desktop.
Save kirkconnell/949255 to your computer and use it in GitHub Desktop.
Get content_ui for log
#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_by_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