aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/clients_controller.rb1
-rw-r--r--app/views/clients/new.html.haml1
-rw-r--r--app/views/clients/show.html.haml5
-rw-r--r--db/migrate/20251030173042_add_address_to_clients.rb5
-rw-r--r--db/schema.rb3
5 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/clients_controller.rb b/app/controllers/clients_controller.rb
index 7ae7c2c..f76b6fa 100644
--- a/app/controllers/clients_controller.rb
+++ b/app/controllers/clients_controller.rb
@@ -38,6 +38,7 @@ class ClientsController < ApplicationController
:first_name,
:last_name,
:mobile_number,
+ :address,
household_members_attributes: [
:first_name,
:last_name,
diff --git a/app/views/clients/new.html.haml b/app/views/clients/new.html.haml
index 763947e..ea5748e 100644
--- a/app/views/clients/new.html.haml
+++ b/app/views/clients/new.html.haml
@@ -9,6 +9,7 @@
= f.input :first_name
= f.input :last_name
= f.input :mobile_number
+ = f.input :address
%h3 Household Members
%table
diff --git a/app/views/clients/show.html.haml b/app/views/clients/show.html.haml
index 8585e12..dd72ba0 100644
--- a/app/views/clients/show.html.haml
+++ b/app/views/clients/show.html.haml
@@ -17,6 +17,11 @@
Mobile Number:
= @client.mobile_number
+ %p
+ %span
+ Address:
+ = @client.address or '-'
+
%h3 Household Members
%p
diff --git a/db/migrate/20251030173042_add_address_to_clients.rb b/db/migrate/20251030173042_add_address_to_clients.rb
new file mode 100644
index 0000000..f2a5b7d
--- /dev/null
+++ b/db/migrate/20251030173042_add_address_to_clients.rb
@@ -0,0 +1,5 @@
+class AddAddressToClients < ActiveRecord::Migration[8.1]
+ def change
+ add_column :clients, :address, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 3277c4e..34547e1 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,11 +10,12 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[8.1].define(version: 2025_10_30_151152) do
+ActiveRecord::Schema[8.1].define(version: 2025_10_30_173042) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
create_table "clients", force: :cascade do |t|
+ t.string "address"
t.datetime "created_at", null: false
t.string "first_name", null: false
t.string "last_name", null: false