-1

I am new to Ruby on Rails. I use scaffold to generate first controller ( model and view), Projects in this case. Scaffold automatically create a form that can use to insert data to project table. I want to add skills to this form, so users can add required skills on project. Once they create project it should add skills table if skills is not available (new skills ) also i want to update projects_skills table ( relation )

Currently i have Project ( Controller ), Project (model ) and Views - using scaffold , Skills (Controller, Model and Views ) manually created

Thanks in advance

Sibin Xavier
  • 196
  • 7

1 Answers1

1

To use a has and belongs to many you will need to create a migration for a join table. The join table, to be rails friendly, should be named after the models with the model names in alphabetical order. For example, if features belong to many widgets and widgets have many features, the join table would be features_widgets. The columns within this table should be feature_id and widget_id.

David Hoelzer
  • 15,862
  • 4
  • 48
  • 67