From 112f350995801a5bd471fedfce5cd85db2dddfd7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 30 Sep 2017 21:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=9B=9E=E5=A4=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 7 +++---- app/views/forums/index.html.erb | 2 +- app/views/messages/_message_reply.html.erb | 2 +- config/routes.rb | 2 ++ db/migrate/20170930122738_modify_sticky_for_memos.rb | 11 +++++++++++ 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20170930122738_modify_sticky_for_memos.rb diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 7e9662563..b96c1774f 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -165,10 +165,9 @@ class MemosController < ApplicationController @flag = false respond_to do |format| - if( #@memo.update_column(:subject, params[:memo][:subject]) && - @memo.update_column(:content, params[:memo][:content]) && - @memo.update_column(:sticky, params[:memo][:sticky]) && - @memo.update_column(:lock, params[:memo][:lock]) && + if( @memo.update_column(:content, params[:memo][:content]) && + @memo.update_column(:sticky, params[:memo][:sticky].to_i) && + @memo.update_column(:lock, params[:memo][:lock].to_i) && @memo.update_column(:subject,params[:memo][:subject]) && @memo.update_column(:updated_at,Time.now)) @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index c6516c87d..a3cbaa03e 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -41,7 +41,7 @@ 顶 <% end %>
-<%= memo.content.html_safe %>
+