From 786932e75b8e3270f929e576ba8c710d800cd008 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Sat, 22 Apr 2023 12:57:02 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/property_hires_controller.rb | 2 +- app/views/admin/property_hires/edit_hire.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/property_hires_controller.rb b/app/controllers/admin/property_hires_controller.rb index 1463d23..c011fc3 100644 --- a/app/controllers/admin/property_hires_controller.rb +++ b/app/controllers/admin/property_hires_controller.rb @@ -255,7 +255,7 @@ class Admin::PropertyHiresController < OrbitAdminController end def phire_params p_hire_params = params.require(:p_hire).permit! - property = Property.find(params[:p_hire][:property_id]) rescue Property.last + property = (@phire ? @phire.property : Property.find(params[:p_hire][:property_id]) rescue nil) if(property.enable_notes_selector rescue false) note_texts = "" property.notes_selector.each do |index,sub_hash| diff --git a/app/views/admin/property_hires/edit_hire.html.erb b/app/views/admin/property_hires/edit_hire.html.erb index ac83e64..7fa7cec 100644 --- a/app/views/admin/property_hires/edit_hire.html.erb +++ b/app/views/admin/property_hires/edit_hire.html.erb @@ -711,7 +711,7 @@ ul.list-unstyled li { <% custom_field_inputs = {} %> <% custom_field_type = {"note_for_hire"=>"text_area"} %> <% if(property.enable_notes_selector rescue false) %> - <% custom_field_inputs["note_for_hire"] = render(:partial=>"notes_selector",:locals=>{:f=>f,:property=>property}) %> + <% custom_field_inputs["note_for_hire"] = render(:partial=>"property_hires/notes_selector",:locals=>{:f=>f,:property=>property}) %> <% end %> <% fields_name = property.get_all_fields %> <% has_p_hire_fields = property.p_hire_fields_enabled.count != 0