def create
      authorize! :create, Post
      @post = Post.new(post_params)
      @post.user_id = current_user.id

      if @post.save
        redirect_to @post, notice: '文章提交成功，需要等待管理员审核。'
      else
        render :new
      end
    end
def create
      authorize! :create, Post
      @post = Post.new(post_params)
      @post.user_id = current_user.id

      if @post.save
        redirect_to @post, notice: '文章提交成功，需要等待管理员审核。'
      else
        render :new
      end
    end
POST /posts