Skip to content

Instantly share code, notes, and snippets.

@rbrancher
Created December 10, 2012 19:47
Show Gist options
  • Save rbrancher/4252859 to your computer and use it in GitHub Desktop.
Save rbrancher/4252859 to your computer and use it in GitHub Desktop.
helper
def mmagick_container(model, relation, media_types = {upload: true, reference: false}, options = {})
data = data_attributes(model, relation, options)
id = "#{model.class.to_s.downcase}-#{relation.to_s}"
classes = "mmagick-wrapper #{relation.to_s}"
content_tag 'div', id: id, class: classes, data: data do
if block_given?
yield
else
render '/wrapper_content', partial_attributes(model, relation, media_types, options)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment