From a4a38201a6c73a833cd4ede72bf2999a7e6bb997 Mon Sep 17 00:00:00 2001 From: chiu Date: Sun, 26 Apr 2020 00:06:11 +0800 Subject: [PATCH] fix error --- app/controllers/personal_journals_controller.rb | 4 +++- app/views/admin/journal_papers/merge.html.erb | 4 ++-- modules/personal_journal/index_search1.html.erb | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index ad3250e..b766e5d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -108,6 +108,7 @@ class PersonalJournalsController < ApplicationController choice = choice.map { |value| value.inject :merge } select_text = t('personal_journal.search_class') search_text = t('personal_journal.word_to_search') + csrf_value = (0...46).map { ('a'..'z').to_a[rand(26)] }.join { 'journal_papers' => journal_paper_list, 'headers' => headers, @@ -115,7 +116,8 @@ class PersonalJournalsController < ApplicationController 'url' => '/' + I18n.locale.to_s + params[:url], 'select_text' => select_text, 'search_text' => search_text, - 'search_value' => params[:keywords] }, + 'search_value' => params[:keywords], + 'csrf_value' => csrf_value }, 'total_pages' => journal_papers_total_pages, 'choice' => choice } diff --git a/app/views/admin/journal_papers/merge.html.erb b/app/views/admin/journal_papers/merge.html.erb index 4571763..86ea2fe 100644 --- a/app/views/admin/journal_papers/merge.html.erb +++ b/app/views/admin/journal_papers/merge.html.erb @@ -61,10 +61,10 @@ function change_mode(){ end %> - <%= key[0].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> + <%= key[0].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') rescue t('personal_journal.no_input') %> - <%= key[1].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') %> + <%= key[1].values.map{|v| v=="" ? t('personal_journal.no_input') : v}.join('/') rescue t('personal_journal.no_input') %> <% if params['mode']=='simple' %> diff --git a/modules/personal_journal/index_search1.html.erb b/modules/personal_journal/index_search1.html.erb index fc23982..b9d7958 100644 --- a/modules/personal_journal/index_search1.html.erb +++ b/modules/personal_journal/index_search1.html.erb @@ -11,8 +11,9 @@ $( ".selectbox" ).ready(function() {

{{widget-title}}

- {{select_text}} - + {{select_text}} +