I get that error in the controller
def create
val=Valoracion.all
val.each do |app|
Rating.create(:user_id => params[:rating][:user_id],
:app_id=> params[:rating][:app_id],
:valoracion_id => app.id,
:valoracion => params[:rating][:valoracion][app.id]
)
end
end
rating.rb
class Rating < ApplicationRecord
belongs_to :app
belongs_to :user
belongs_to :valoracion
end
valoracion.rb
class Valoracion < ApplicationRecord
has_many :ratings
end