ActionController::ParameterMissing (param is missing or the value is empty: film):

后端 未结 3 997
轻奢々
轻奢々 2020-12-01 14:34

So, I\'m getting the following error when trying to visit the films page on my app:

ActionController::ParameterMissing (param is missing or the value is empt         


        
3条回答
  •  时光说笑
    2020-12-01 15:21

    I have got this problem too when I use Angular JS form to send data to backend Rails 4. When I did not fill anything in angular js form, the error will show ActionController::ParameterMissing (param is missing or the value is empty:.

    I fix it by adding params.fetch(:film, {}) the strong parameter into:

    params.fetch(:film, {}).permit(:name, :sort_name, :description, :short_description, :meta_data,
        :poster, :amazon_link, :active, :trackable, :country_ids => [])
    

    I refer to code example to avoid ActionController::ParameterMissing (param is missing or the value is empty: film)

    I hope this will help you.

提交回复
热议问题