From 9eaf2447a62e235d398e1afd7557a4e680348028 Mon Sep 17 00:00:00 2001 From: bohung Date: Sun, 3 Jan 2021 15:47:20 +0800 Subject: [PATCH] Fix bugs. --- app/controllers/admin/venue_management_bills_controller.rb | 2 +- app/views/admin/venue_management_bills/_form.html.erb | 1 + app/views/admin/venue_management_bills/_index.html.erb | 2 +- app/views/admin/venue_managements/_form.html.erb | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/venue_management_bills_controller.rb b/app/controllers/admin/venue_management_bills_controller.rb index 093886d..77c44d9 100644 --- a/app/controllers/admin/venue_management_bills_controller.rb +++ b/app/controllers/admin/venue_management_bills_controller.rb @@ -148,7 +148,7 @@ class Admin::VenueManagementBillsController < Admin::VenueAdminController @venue_management = VenueManagementMain.find(@venue_management_bill.venue_management_main_id) end def copy - @venue_management_bill_to_copy = VenueManagementBill.find(params[:id]) + @venue_management_bill_to_copy = VenueManagementBill.find(params[:bill_id]) attributes = @venue_management_bill_to_copy.attributes.except("_id","updated_at","created_at") VenueManagementBill.fields.each do |k,v| if v.options[:localize] diff --git a/app/views/admin/venue_management_bills/_form.html.erb b/app/views/admin/venue_management_bills/_form.html.erb index 13b7c85..5b2ba02 100644 --- a/app/views/admin/venue_management_bills/_form.html.erb +++ b/app/views/admin/venue_management_bills/_form.html.erb @@ -26,6 +26,7 @@ margin: 0; } +

<%= t('venue_management.title') %> : <%= @venue_management_bill.venue_management_main.title %>

<% new_record = @venue_management_bill.new_record? && params["action"] != "copy" %> diff --git a/app/views/admin/venue_management_bills/_index.html.erb b/app/views/admin/venue_management_bills/_index.html.erb index 29c8f67..4ada13e 100644 --- a/app/views/admin/venue_management_bills/_index.html.erb +++ b/app/views/admin/venue_management_bills/_index.html.erb @@ -29,7 +29,7 @@ diff --git a/app/views/admin/venue_managements/_form.html.erb b/app/views/admin/venue_managements/_form.html.erb index da3ea1e..d30e82e 100644 --- a/app/views/admin/venue_managements/_form.html.erb +++ b/app/views/admin/venue_managements/_form.html.erb @@ -456,7 +456,7 @@
- <%= f.fields_for :area_translations do |f| %> + <%= f.fields_for "#{area}_translations" do |f| %> <%= f.text_field locale, class: "input-block-level", :value => (@venue_management.send("#{area}_translations")[locale] rescue nil),placeholder: t("venue_management.#{area}") %> <% end %>