dimanche 3 mai 2015

Ruby on Rails ActiveRecord select

I am trying to create a ActiveRecord database by using Ruby on Rails

I have created a database Schema:

enter image description here

To create tables destinations, productions, rules I am using rails generate model Name parameter:integer

How to create a table rule_input with foreign key to rule?

Also, how to create a table or a model sources that would join all these tables and I could get source like: source = Source.find(1) and for example render json: {source: source}?

Aucun commentaire:

Enregistrer un commentaire