From 426ea23d6e35d55814fec86046407b986ef62bfa Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 4 Aug 2014 17:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=B8=96=E5=AD=90=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 11 ++++++++--- app/views/memos/_reply_box.html.erb | 2 +- app/views/memos/quote.js.erb | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 7f71c2085..d7510c385 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -40,12 +40,17 @@ class MemosController < ApplicationController end def create - unless params[:quote].nil? - @quote = params[:quote][:quote] - else + + if params[:quote].nil? @quote = "" + else + @quote = params[:quote] end + #unless params[:quote].nil? + # @quote = params[:quote][:quote] + #end + @memo = Memo.new(params[:memo]) @memo.forum_id = params[:forum_id] @memo.author_id = User.current.id diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb index 18cfa032d..9dddf5be4 100644 --- a/app/views/memos/_reply_box.html.erb +++ b/app/views/memos/_reply_box.html.erb @@ -4,7 +4,7 @@ <%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
- <%= text_area :quote,:quote,:style => 'display:none' %> + <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> <%= label_tag(l(:label_reply_plural)) %>: <%= f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'editor01', :value => @content %>

diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index a72b7ac9e..d2e8c1d17 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,4 +1,4 @@ //ckeditor.setData("<%= raw escape_javascript(@content) %>"); $('#message_quote').html("<%= raw escape_javascript(@temp.content) %>"); -$('#quote_quote').html("<%= raw escape_javascript(@content) %>"); +$('#quote').val("<%= raw escape_javascript(@content) %>"); showAndScrollTo("new_memo", "cke_editor01"); \ No newline at end of file