From 065d38c797503793b601159c00edb7439e84a41e Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Mon, 26 Nov 2012 14:44:35 +0800 Subject: [PATCH] add autocomplete js --- app/controllers/desktop/journal_pages_controller.rb | 7 ++++++- app/views/desktop/journal_pages/_form.html.erb | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/desktop/journal_pages_controller.rb b/app/controllers/desktop/journal_pages_controller.rb index 6288cdbf..66c613ef 100644 --- a/app/controllers/desktop/journal_pages_controller.rb +++ b/app/controllers/desktop/journal_pages_controller.rb @@ -18,6 +18,11 @@ class Desktop::JournalPagesController < ApplicationController @level_types = JournalLevelType.all @author_types = JournalAuthorType.all @paper_types= JournalPaperType.all + @co_author_candidate = + CoAuthor.where(name_id: current_user.id).map{|c|c.co_author} + @journal_candidate = + WritingJournal.where(create_user_id: current_user.id).map{|j|j.journal_title}.uniq + respond_to do |format| format.html { render :layout => false} @@ -26,7 +31,7 @@ class Desktop::JournalPagesController < ApplicationController end def edit - @writing_journal= WritingJournal.find(params[:id]) + @writing_journal = WritingJournal.find(params[:id]) @level_types = JournalLevelType.all @author_types = JournalAuthorType.all @paper_types= JournalPaperType.all diff --git a/app/views/desktop/journal_pages/_form.html.erb b/app/views/desktop/journal_pages/_form.html.erb index 20fad7a1..b2328dc4 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -207,3 +207,6 @@ +