Undefined method 'event_id_select' - Ruby on Rails

0

I have to create a DropDown depending on the data of a table in my database, I have a line of code that I think I can do it but I have an error Undefined method of event_id_select where I can declare it or how I can resove it , I'm new by programming in Ruby on rails.

<%= f.collection_select(:event_id_select, Event.all, :id, :name) %>
    
asked by AlexCs 22.07.2018 в 20:59
source

1 answer

2

event_id_select is not an attribute in your model, you must use the correct attribute / column, which should be (if you followed the Rails standards) event_id :

<%= f.collection_select(:event_id, Event.all, :id, :name) %>
    
answered by 22.07.2018 / 21:15
source