博客按更新时间排序

This commit is contained in:
ouyangxuhua 2016-01-22 15:05:52 +08:00
parent a15f7fa97b
commit b5159d54c8
2 changed files with 1 additions and 2 deletions

View File

@ -2,7 +2,6 @@ class BlogsController < ApplicationController
before_filter :find_blog,:except => [:index,:create,:new,:set_homepage, :cancel_homepage]
before_filter :find_user
def index
@articls = @user.blog.articles.order("updated on desc")
@article = BlogComment.new
respond_to do |format|
format.html {render :layout=>'new_base_user'}

View File

@ -30,7 +30,7 @@
<%= import_ke(enable_at: false, prettify: false) %>
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.created_on desc"), :page => 0, :user => @user} %>
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.updated_on desc"), :page => 0, :user => @user} %>
<script type="text/javascript">//侧导航