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=""