Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kabturek/3742337 to your computer and use it in GitHub Desktop.
Save kabturek/3742337 to your computer and use it in GitHub Desktop.
:ruby
puts catalog_items.map { |catalog_item|
{ 'carpet_detail' => catalog_item.carpet_detail,
'carpet_style_colors_manufacturer_name' => catalog_item.carpet_style_colors_manufacturer_name,
'carpet_style_name' => catalog_item.carpet_style_name,
'scene7_source' => scene7_source(catalog_item.carpet_style_colors_scene7_image_id),
'scene7_source_product_large' => scene7_source(catalog_item.carpet_style_colors_scene7_image_id, 'product-large'),
'scene7_source_product_small' => scene7_source(catalog_item.carpet_style_colors_scene7_image_id, 'product-small'),
'scene7_source_room_scene' => scene7_source(catalog_item.carpet_scene7_room_scene_image_id) }
}.to_json
xml.instruct!
xml.publication do
xml.id @publication.id
xml.title @publication.title
xml.articles do
@publication.news.ordered.each do |article|
xml.article do
xml.id article.id
xml.title article.title
xml.author article.author
xml.publish_on article.story_date.to_s(:story_date)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment