Monday, 26 May 2014

Unpermitted parameters not saving in database of rails4

Unpermitted parameters: pid, rating

we can make permit-able by adding these two fields in  a private method of your controller [controler]_params

ex: reviews_controller

method:

     def review_params
      params.require(:review).permit(:name, ....... :beggrgrill, :rating, :pid)
    end

No comments:

Post a Comment