4
I’m trying to create a simple contact schedule with two tables: Being one of them empresa :nome
and the other contatos :nome :telefone :email
... I created the two tables and put a Foreign_key in the second that will receive the empresa_id of the first.
In the form of the second table I put a f.collection_select
of the following maeira: <%= f.collection_select :empresa,Empresa.order('nome Asc'),:id, :nome,{prompt: "Selecione uma empresa"},{class: "form-control"} %>
. It works only when I select the company and include the other fields the company id not saved in the Bank. Could you help me by telling me where I’m going wrong?
Welcome to Stackoverflow! Apparently the
collection_select
, We need more information: Do you mind editing the question and putting the controller code?– user7261
@Andrey Then take a look at the Magic links like
[pt.so]
in http://meta.pt.stackoverflow.com/questions/1616/quais-s%C3%A3o-todos-os-Magic-links-que-possu%C3%Admos helps to decrease the number of– Caputo
@Caputo I always forget it =P I’ll try to remember in the next
– user7261