app/controllers/posts_controller.rb
# We don't want anybody anonymous to create new Posts.
# So in all child controllers this filter will work fine. 
We don't want anybody anonymous to create new Posts.
So in all child controllers this filter will work fine.
We don ' t want anybody anonymous to create new Posts . So in all child controllers this filter will work fine .
def show
    @post = Post.find_by_permalink(params[:id], :include => :comments)
    @comments = @post.comments
    if current_user
      @comment = UserComment.new
    else
      @comment = GuestComment.new
    end
    @comment.post = @post
  end
def show @post = Post . find_by_permalink ( params [ :id ] , :include => :comments ) @comments = @post . comments if current_user @comment = UserComment . new else @comment = GuestComment . new end @comment . post = @post end
We don't want anybody anonymous to create new Posts.
We don ' t want anybody anonymous to create new Posts .