From 931171e25eecb07d6c32de088af488814742c6e9 Mon Sep 17 00:00:00 2001 From: bohung Date: Mon, 21 Sep 2020 23:29:30 +0800 Subject: [PATCH] Fix bug. --- app/models/course.rb | 4 ++-- app/views/admin/courses/_form_assignment.html.erb | 2 +- app/views/admin/courses/course_assignments.html.erb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index 50c9bd9..fc839bf 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -39,9 +39,9 @@ class Course record.student_ids.each do |student_id| selected_course = SelectedCourse.where(:member_profile_id => student_id,:course_id=>record.id).first if selected_course.nil? - SelectedCourse.create(:member_profile => MemberProfile.find(student_id) , :course_id=>record.id , :year=>record.year,:course_title_translations=>record.title_translations,:course_objective_translations=>record.objective_translations) + SelectedCourse.create(:member_profile => MemberProfile.find(student_id) , :course_id=>record.id , :year=>record.year,:course_title_translations=>record.title_translations) else - selected_course.update(:year=>record.year,:course_title_translations=>record.title_translations,:course_objective_translations=>record.objective_translations) + selected_course.update(:year=>record.year,:course_title_translations=>record.title_translations) end end student_ids_remove.each do |student_id| diff --git a/app/views/admin/courses/_form_assignment.html.erb b/app/views/admin/courses/_form_assignment.html.erb index 7d997f9..dbe540d 100644 --- a/app/views/admin/courses/_form_assignment.html.erb +++ b/app/views/admin/courses/_form_assignment.html.erb @@ -55,7 +55,7 @@
<%= f.fields_for :detail_translations do |f| %> - <%= f.text_field locale, class: "input-block-level", placeholder: t("personal_course.detail"), value: (@course_assignment.detail_translations[locale] rescue nil) %> + <%= f.text_area locale, class: "input-block-level ckeditor", placeholder: t("personal_course.detail"), value: (@course_assignment.detail_translations[locale] rescue nil) %> <% end %>
diff --git a/app/views/admin/courses/course_assignments.html.erb b/app/views/admin/courses/course_assignments.html.erb index 78063c6..fe349d6 100644 --- a/app/views/admin/courses/course_assignments.html.erb +++ b/app/views/admin/courses/course_assignments.html.erb @@ -55,7 +55,7 @@ - <%= course_assignment.detail %> + <%= course_assignment.detail.html_safe %> <%= course_assignment.display_attachments %> <%= course_assignment.display_assign_date %> <%= course_assignment.display_deadline %>