Update property_hires_controller.rb show issue

This commit is contained in:
wmcheng 2019-06-14 01:26:53 +08:00
parent e1e90a83cf
commit cb4065aef7
1 changed files with 14 additions and 12 deletions

View File

@ -79,7 +79,7 @@ class PropertyHiresController < ApplicationController
"header" => t("property_hire.can_be_hired"),
"value" => (property.can_be_hired ? "<span class='label label-success'>Yes</span>" : "<span class='label label-danger'>No</span>")
}
if !property_hire.purchase_date.blank?
if !property_hire.purchase_date.to_s.blank?
data << {
"header" => t("property_hire.purchase_date"),
"value" => property.purchase_date.strftime("%Y-%m-%d")
@ -90,34 +90,36 @@ class PropertyHiresController < ApplicationController
else
owners = property.owner_profiles.collect{|mp| mp.name}.join(",")
end
if !property_hire.owners.blank?
if !owners.blank?
data << {
"header" => t("property_hire.owners"),
"value" => owners
}
end
if !property_hire.owner_email.blank?
if !property.owner_email.blank?
data << {
"header" => t("property_hire.owner_email"),
"header" => t("property_hire.owner_email"),
"value" => property.owner_email
}
end
if !property_hire.owner_phone.blank?
if !property.owner_phone.blank?
data << {
"header" => t("property_hire.owner_phone"),
"header" => t("property_hire.owner_phone"),
"value" => property.owner_phone
}
end
if !property_hire.price.blank?
if !property.price.blank?
data << {
"header" => t("property_hire.price"),
"header" => t("property_hire.price"),
"value" => property.price
}
end
if !property.get_location_name.blank?
data << {
"header" => t("property_hire.location"),
"value" => property.get_location_name
}
end
data << {
"header" => t("property_hire.location"),
"value" => property.get_location_name
}
actions = []
if property.can_be_hired
actions << {