From f332307caeb893bc5ffbf05c38cf5ca8b4cff3c3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Dec 2016 16:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=B4=B4=E5=90=A7=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 13 +++++++++++++ app/views/memos/_my_count_message.html.erb | 19 ++++++++++--------- config/routes.rb | 1 + 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index a47d8ee09..057a056f3 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -271,6 +271,19 @@ class ForumsController < ApplicationController end end + # 更新贴吧描述 + def update_memo_description + @forum = Forum.find(params[:id]) + if @forum.blank? + result = { :result => false } + else + forum_decription = params[:forum][:description] + @forum.update_attributes(:description => forum_decription ) + result = { :result => true } + end + render :json => result + end + def search_forum # @forums = paginateHelper Forum.where("name LIKE '%#{params[:name]}%'") q = "%#{params[:name].strip}%" diff --git a/app/views/memos/_my_count_message.html.erb b/app/views/memos/_my_count_message.html.erb index 36c500cf0..16af682ba 100644 --- a/app/views/memos/_my_count_message.html.erb +++ b/app/views/memos/_my_count_message.html.erb @@ -5,7 +5,8 @@
<% user_name = @forum.creator.show_name.empty? ? @forum.creator.name : @forum.creator.show_name %> -
吧主:
<%= user_name %> +
吧主:
+ <%= user_name %>
回答:<%= @my_replies_count %> 帖子:<%= @my_topic_count %>
@@ -13,8 +14,9 @@ <%= link_to @forum.name, forum_path(@forum), :class => "f16 fontBlue", :style => "word-break: break-all; word-wrap:break-word;white-space:pre-wrap;" %>
-
<%= @forum.description.html_safe%> - <%if @forum.creator.id == User.current.id%> +
+ <%= h @forum.description.html_safe%> + <% if @forum.creator.id == User.current.id %> <%= image_tag('signature_edit.png',{:width => 12,:height => 12}) %> @@ -49,23 +51,22 @@