I have a form ;
<%= form_for @boats do |f| %>
<%= f.collection_select(:brand, :brand_id, @brands, :id, :name, {:prompt => "Select a Brand"}, {:id => 'brands_select'}) %>
<%= f.collection_select(:year, :year_id, @years, :id, :name, {:prompt => "Select a Year"}, {:id => 'years_select'}) %>
<%= f.collection_select(:model, :model_id, @models, :id, :name, {:prompt => "Select a Model"}, {:id => 'models_select'}) %>
<%= f.submit "Create my account" %>
<% end %>
and have controller #index;
def index
@boats = Boat.new
@brands = Brand.all
@years = Year.all
@models = Model.all
end
But the problem here is that, when I run the code it gives an error of;
So I am not sure what to do. Basically, the data comes from the databases and I would like to save them to Boat database where the column names are Brand, Year and Model.