<%= form.label :name, class: "font-bold text-white text-base" %>
- <%= form.text_field :name, value: @profile.name, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+ <%= form.text_field :name, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+
+ <%= form.label :bio, class: "font-bold text-white text-base" %>
+ <%= form.text_area :bio, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
<%= form.label :location, class: "font-bold text-white text-base" %>
- <%= form.text_field :location, value: @profile.location, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+ <%= form.text_field :location, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
<%= form.label :github_url, class: "font-bold text-white text-base" %>
- <%= form.text_field :github_url, value: @profile.github_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+ <%= form.text_field :github_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
<%= form.label :linkedin_url, class: "font-bold text-white text-base" %>
- <%= form.text_field :linkedin_url, value: @profile.linkedin_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+ <%= form.text_field :linkedin_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
<%= form.label :twitter_url, class: "font-bold text-white text-base" %>
- <%= form.text_field :twitter_url, value: @profile.twitter_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
+ <%= form.text_field :twitter_url, class: "w-full text-white border-2 border-white bg-transparent rounded-sm mb-6 focus:outline-none focus:outline-0 focus:ring-0 focus:border-2 focus:border-white active:border-2 active:border-white" %>
- <%= form.label :mail_notifications_enabled, "Mail Notifications", class: "grow font-medium text-slate-900 text-base cursor-pointer mr-2" %>
+ <%= form.label :mail_notifications, "Mail", class: "grow font-medium text-slate-900 text-base cursor-pointer mr-2" %>
- <%= form.label :in_app_notifications_enabled, "In app Notifications", class: "grow font-medium text-slate-900 text-base cursor-pointer mr-2" %>
+ <%= form.label :in_app_notifications, "In app", class: "grow font-medium text-slate-900 text-base cursor-pointer mr-2" %>
diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb
index b7d5e507..e038008c 100644
--- a/app/views/profiles/show.html.erb
+++ b/app/views/profiles/show.html.erb
@@ -1,4 +1,3 @@
-
- <%= link_to 'EDIT PROFILE', edit_profile_path, class: "w-full bg-white text-red-500 font-bold rounded-sm p-4 rounded-lg grow flex flex-row items-center justify-center" %>
+ <%= link_to 'EDIT PROFILE', edit_profile_path, class: "w-full bg-white text-red-500 font-bold rounded-sm p-4 rounded-lg grow flex flex-row items-center justify-center" %>
diff --git a/db/migrate/20240628210301_create_profiles.rb b/db/migrate/20240628210301_create_profiles.rb
index c444d827..04052223 100644
--- a/db/migrate/20240628210301_create_profiles.rb
+++ b/db/migrate/20240628210301_create_profiles.rb
@@ -2,11 +2,13 @@ class CreateProfiles < ActiveRecord::Migration[7.1]
def change
create_table :profiles do |t|
t.string :name
- t.string :bio
+ t.text :bio
t.string :location
t.string :github_url
t.string :linkedin_url
t.string :twitter_url
+ t.boolean :mail_notifications, default: true, null: false
+ t.boolean :in_app_notifications, default: true, null: false
t.boolean :is_public, default: false, null: false
t.references :profileable, polymorphic: true, null: false
diff --git a/db/migrate/20240628211820_create_users.rb b/db/migrate/20240628211820_create_users.rb
index be93835d..4b835b5d 100644
--- a/db/migrate/20240628211820_create_users.rb
+++ b/db/migrate/20240628211820_create_users.rb
@@ -3,8 +3,6 @@ def change
create_table :users do |t|
t.string :email, null: false
t.string :role
- t.boolean :mail_notifications_enabled, default: true, null: false
- t.boolean :in_app_notifications_enabled, default: true, null: false
t.string :password_digest, null: false
t.timestamps
diff --git a/db/schema.rb b/db/schema.rb
index 38d4510c..81791c27 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -99,11 +99,13 @@
create_table "profiles", force: :cascade do |t|
t.string "name"
- t.string "bio"
+ t.text "bio"
t.string "location"
t.string "github_url"
t.string "linkedin_url"
t.string "twitter_url"
+ t.boolean "mail_notifications", default: true, null: false
+ t.boolean "in_app_notifications", default: true, null: false
t.boolean "is_public", default: false, null: false
t.string "profileable_type", null: false
t.integer "profileable_id", null: false
@@ -127,8 +129,6 @@
create_table "users", force: :cascade do |t|
t.string "email", null: false
t.string "role"
- t.boolean "mail_notifications_enabled", default: true, null: false
- t.boolean "in_app_notifications_enabled", default: true, null: false
t.string "password_digest", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
diff --git a/db/seeds.rb b/db/seeds.rb
index 16de4ebb..e8a88a2c 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -2,6 +2,19 @@
# Users
user = User.create!(email: "dev@example.com", password: "foobar2024", password_confirmation: "foobar2024")
+User.create!(email: "dev+1@example.com", password: "foobar2024", password_confirmation: "foobar2024")
+
+# Profiles
+user.create_profile!(
+ name: "John Doe",
+ bio: "I'm a Ruby on Rails developer.",
+ is_public: true,
+ mail_notifications: true,
+ in_app_notifications: true,
+ github_url: "https://github.com/TelosLabs",
+ twitter_url: "https://x.com/teloslabs",
+ linkedin_url: "https://www.linkedin.com/company/telos-labs"
+)
# Tags
Tag.create!(name: "Hotwire")
diff --git a/spec/factories/profiles.rb b/spec/factories/profiles.rb
index 4d36ec19..c7eb1602 100644
--- a/spec/factories/profiles.rb
+++ b/spec/factories/profiles.rb
@@ -2,18 +2,20 @@
#
# Table name: profiles
#
-# id :integer not null, primary key
-# bio :string
-# github_url :string
-# is_public :boolean default(FALSE), not null
-# linkedin_url :string
-# location :string
-# name :string
-# profileable_type :string not null
-# twitter_url :string
-# created_at :datetime not null
-# updated_at :datetime not null
-# profileable_id :integer not null
+# id :integer not null, primary key
+# bio :text
+# github_url :string
+# in_app_notifications :boolean default(TRUE), not null
+# is_public :boolean default(FALSE), not null
+# linkedin_url :string
+# location :string
+# mail_notifications :boolean default(TRUE), not null
+# name :string
+# profileable_type :string not null
+# twitter_url :string
+# created_at :datetime not null
+# updated_at :datetime not null
+# profileable_id :integer not null
#
# Indexes
#
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index 7f25f9e4..2d1d1d0a 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -2,14 +2,12 @@
#
# Table name: users
#
-# id :integer not null, primary key
-# email :string not null
-# in_app_notifications_enabled :boolean default(TRUE), not null
-# mail_notifications_enabled :boolean default(TRUE), not null
-# password_digest :string not null
-# role :string
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :integer not null, primary key
+# email :string not null
+# password_digest :string not null
+# role :string
+# created_at :datetime not null
+# updated_at :datetime not null
#
# Indexes
#
diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb
index fe96c6cd..b8feb2fe 100644
--- a/spec/models/profile_spec.rb
+++ b/spec/models/profile_spec.rb
@@ -2,18 +2,20 @@
#
# Table name: profiles
#
-# id :integer not null, primary key
-# bio :string
-# github_url :string
-# is_public :boolean default(FALSE), not null
-# linkedin_url :string
-# location :string
-# name :string
-# profileable_type :string not null
-# twitter_url :string
-# created_at :datetime not null
-# updated_at :datetime not null
-# profileable_id :integer not null
+# id :integer not null, primary key
+# bio :text
+# github_url :string
+# in_app_notifications :boolean default(TRUE), not null
+# is_public :boolean default(FALSE), not null
+# linkedin_url :string
+# location :string
+# mail_notifications :boolean default(TRUE), not null
+# name :string
+# profileable_type :string not null
+# twitter_url :string
+# created_at :datetime not null
+# updated_at :datetime not null
+# profileable_id :integer not null
#
# Indexes
#
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index db4430e7..3a217047 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -2,14 +2,12 @@
#
# Table name: users
#
-# id :integer not null, primary key
-# email :string not null
-# in_app_notifications_enabled :boolean default(TRUE), not null
-# mail_notifications_enabled :boolean default(TRUE), not null
-# password_digest :string not null
-# role :string
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :integer not null, primary key
+# email :string not null
+# password_digest :string not null
+# role :string
+# created_at :datetime not null
+# updated_at :datetime not null
#
# Indexes
#