I have a user model with name, email and password.
Now I want to add languages know by the user to the user model.
I can do that by the following
rails generate migration add_languagesknown_to_users
languagesknown:string
But I want the user to have the capability to store multiple languages.
Some users will know only one language some might know 10.
And,
I have a view to search all users when the search button is clicked. But
later I want to search users using languages known field. Can someone
kindly share on how do I create a migration for such use?
For instance, a user “Sam” signs up with English and Spanish as known
languages;
when users search for users who know English, Sam should be listed;
when users search for users who know Spanish, Sam should be listed.
How do I create a migration for this?
Should i create a table of languages and associate it with the user
model?
Can anybody share how please?