خرید بک لینک

Vote count: 0

I'm writing an app in Rails 5 with the gem 'best-in-place' being used for the update action view. Even though the app works fine and updates the right parameters of the right offer, the test suite throws up this error:

ActiveRecord::RecordNotFound: Couldn't find Offer with 'id'=
app/controllers/offers_controller.rb:71:in `correct_user'

Here is the offending code. It is a before filter for the update action:

70: def correct_user
71:     @offer = Offer.find params[:id]
72:     @user = @offer.user
73:     redirect_to(root_url) unless current_user?(@user)
    end

but the PUT clearly has the id paramater defined as id = '109':

Started PUT "/offers/109" for 127.0.0.1 at 2017-04-11 17:21:33 -0400
Processing by OffersController#update as JSON
Parameters: {"offer"=>{"category"=>"d"},     "authenticity_token"=>"9Y94wYzCrCvyygNk5GJXRe488JPd51YCSWQLe6Lpo3MgglfK1SrI1NcEj334T9HaAkAazlS212i4FZ+akDyelg==", "id"=>"109"}

If you need more information, please let me know. Any help is appreciated. Thanks.

asked 40 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 23 فروردين 1396 ساعت: 4:58

صفحه بندی