Users want to be able to attach links to social media on their profile page.
The currently existing profiles table could have new fields for each of the links we want to support:
def change
add_column :profiles, :twitter_link, :string
add_column :profiles, :linked_in_link, :string
add_column :profiles, :github_link, :string
# etc.
end
Pros
Cons
Link
modelFirst off: the name of this should probably be less generic. SocialMediaLinks
, ProfileLinks
, SocialLinks
, ā something like this is probably a better name. Iām not immediately sure what it should be though.
But the idea would be to create a new table that houses these things.
def change
create_table :links do |t|
t.references :profile, null: false, foreign_key: true
t.string :url, null: false
t.timestamps
end
end
Pros