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_by_id
    @post = Post.find(params[:id])
    if @post
      redirect_to post_path(@post.permalink)
    end
  end
def show_by_id @post = Post . find ( params [ :id ] ) if @post redirect_to post_path ( @post . permalink ) end end
We don't want anybody anonymous to create new Posts.
We don ' t want anybody anonymous to create new Posts .