Skip to content

Instantly share code, notes, and snippets.

@salami-art
Last active February 19, 2018 11:56
Show Gist options
  • Save salami-art/fc6f0f785b0f7956c744a2f85d9ae53a to your computer and use it in GitHub Desktop.
Save salami-art/fc6f0f785b0f7956c744a2f85d9ae53a to your computer and use it in GitHub Desktop.
def contents_listing_block_for(object_list, title, &block)
tag.div :class => 'card' do
capture do
concat tag.header :class => 'card__header' do
concat title
end
concat tag.section :class => 'card__body' do
concat tag.ul :class => 'listing' do
object_list.each do |object|
concat link_to get_mix_content_show_url(object) do
concat yield object
end
end
end
end
concat tag.footer :class => 'card__footer' do
concat paginate object_list
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment