Skip to content

Commit

Permalink
added listglobally format XML index to properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jadehopepunk committed Sep 12, 2012
1 parent 532519b commit 91ce406
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,26 @@ def first_image
def description_preview
headline
end

def address_street
street_address.blank? ? 'Mytton Heights' : street_address
end

def city
'Motueka'
end

def state
'Tasman'
end

def country_code
'NZ'
end

def post_code
'7175'
end

private

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
xml.instruct!
xml.properties do
@properties.each do |property|
xml.property(:status => 'updated') do
xml.reference_code property.id
xml.location do
xml.street property.address_street
xml.city property.city
xml.region property.state
xml.country property.country_code
xml.tag! 'postal-code', property.post_code
xml.longitude property.longitude
xml.latitude property.latitude
end
xml.features do
xml.neighbourhood_is_farm true
end
xml.price do
xml.min property.total_price
xml.currency 'NZD'
end
xml.property_type 'Land'
xml.link refinery.properties_property_url(property)
xml.long_description strip_tags(property.description)
xml.land_area_sqm property.land_area_sqm
xml.images do
property.images.each do |image|
xml.image do
xml.url image.url(:host => "http://#{request.host}")
end
end
end
end
end
end

0 comments on commit 91ce406

Please sign in to comment.