From 7e3141d4f07cde10584e298e19b9330654c44f7b Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 28 May 2020 17:30:03 +0800 Subject: [PATCH] add property title --- app/controllers/admin/property_hires_controller.rb | 2 +- app/views/admin/property_hires/my_bookings.html.erb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 6f0e8c8..1c512bb 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -15,7 +15,7 @@ class Admin::PropertyHiresController < OrbitAdminController end def my_bookings - @table_fields = ["property_hire.hiring_person_name", "property_hire.reason_for_hire", "property_hire.hiring_person_number", "property_hire.period", "property_hire.passed", :actions] + @table_fields = ["property_hire.title","property_hire.hiring_person_name", "property_hire.reason_for_hire", "property_hire.hiring_person_number", "property_hire.period", "property_hire.passed", :actions] @bookings = PHire.where(:hiring_person_id => current_user.member_profile.id.to_s).desc(:created_at).page(params[:page]).per(10) end diff --git a/app/views/admin/property_hires/my_bookings.html.erb b/app/views/admin/property_hires/my_bookings.html.erb index 84dbb80..f4b3036 100644 --- a/app/views/admin/property_hires/my_bookings.html.erb +++ b/app/views/admin/property_hires/my_bookings.html.erb @@ -10,6 +10,9 @@ <% @bookings.each do |p_hire| %> + + <%= p_hire.property.title rescue nil %> + <%= p_hire.hirer_name %>