2
Hello everyone all good? I’m starting on Rails and got a little problem to make a simple web application with:
- Customer registration (with name and address)
- Employee register (only with name)
- Work order register (with the date on which the O.S. was open, the client of this O.S., text with problem reported by customer, the employee who was activated to solve the problem of client and a boolean field to indicate if O.S. has been solved)
**All containing the CRUD
I created the Scaffolds
rails g scaffold Costumer name:string adress:string
rails g scaffold Employee name:string
Here comes the however. I created Scaffold so to make the relationship that exists:
rails g scaffold OrderService date:datetime description:text Costumer:reference Employee:references
I gave the rake db:create db:migrate
to make everything happen in the bank
But then I don’t know what to do, if I use belongs_to, has_many...?
Hello @Vitorc. Avoid putting links in your reply. You can put them as an add-on, but you should always try to post code that helps in solving the problem.
– João Martins