don't render page-viewer twice; last_post should actually get the last post posted, not the first one

This commit is contained in:
danielgrippi 2012-02-24 21:48:37 -08:00
parent dc0b5db0ac
commit 73f224e690
3 changed files with 4 additions and 5 deletions

View file

@ -110,7 +110,7 @@ class PeopleController < ApplicationController
def last_post
@person = Person.find_from_guid_or_username(params)
last_post = Post.visible_from_author(@person, current_user).last
last_post = Post.visible_from_author(@person, current_user).order('posts.created_at DESC').first
redirect_to post_path(last_post)
end

View file

@ -39,8 +39,7 @@ app.Router = Backbone.Router.extend({
},
singlePost : function(id) {
var page = new app.pages.PostViewer({ id: id }).render();
var page = new app.pages.PostViewer({ id: id });
$("#container").html(page.el);
}
});