Loading

rails create方法ActiveModel::ForbiddenAttribute的问题

rails create方法ActiveModel::ForbiddenAttribute的问题

  def create
    @ad = Ad.new(ad_params)
    @ad.save
  end

private
def ad_params params.require(:ad).permit(:name, :description, :price, :seller_id, :email, :img_url) end

 

posted @ 2017-04-16 21:19  stono  阅读(200)  评论(0编辑  收藏  举报