From 6267b9d465e11a17b765ea88edc0bcf8a8e7138e Mon Sep 17 00:00:00 2001 From: yafeilee Date: Mon, 31 Mar 2014 23:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8F=E8=A7=88=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=B8=8E=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/blogs_controller.rb | 1 + app/views/layouts/admin.html.slim | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index a6fd08c..f59e43a 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -13,6 +13,7 @@ class BlogsController < ApplicationController def show @post = Post.find(params[:id]) + @post.visited @prev = Post.where(:created_at.lt => @post.created_at).desc(:created_at).where(:id.ne => @post.id).first @next = Post.where(:created_at.gt => @post.created_at).asc(:created_at).where(:id.ne => @post.id).first @comments = @post.comments diff --git a/app/views/layouts/admin.html.slim b/app/views/layouts/admin.html.slim index c73fca3..12e5db3 100644 --- a/app/views/layouts/admin.html.slim +++ b/app/views/layouts/admin.html.slim @@ -21,6 +21,9 @@ html = link_to '创建新博客', new_admin_post_path li = link_to '管理博客', admin_posts_path + ul.right + li + = link_to '返回首页', root_path - flash.each do |name, msg| - if msg.is_a?(String) div class=("alert-box #{name == :notice ? "success" : "alert"}") data-alert=""