def posts @posts = Post.published.page(params[:page]).per(10) end def show_post @post = Post.friendly.find(params[:id]) rescue redirect_to root_path end