Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 0992f1f

Browse files
committed
display shipping address on user profile page
1 parent 752ab32 commit 0992f1f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

app/views/users/edit.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
= pa.input :city, required: false
115115
= pa.input :state_or_province, required: false
116116
= pa.input :postal_code, required: false
117-
= pa.input :country, required: false
117+
= pa.input :country, as: :country, label: "Country", prompt: "Select your country", required: false
118118

119119

120120
- if admin?

app/views/users/show.html.slim

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,27 @@ nav.actions
6565
p = @user.company_info
6666

6767
- if can_see_private_info?
68-
- fields = ['tshirt_size', 'tshirt_cut', 'postal_address']
6968
.well.private-info
7069
h3 Private info
70+
h4 Postal Address
71+
p
72+
- if @user.postal_address.address_line_1
73+
= @user.postal_address.address_line_1
74+
br
75+
- if @user.postal_address.address_line_2
76+
= @user.postal_address.address_line_2
77+
br
78+
- if @user.postal_address.city
79+
= @user.postal_address.city
80+
br
81+
- if @user.postal_address.state_or_province
82+
= @user.postal_address.state_or_province
83+
br
84+
- if @user.postal_address.postal_code
85+
= @user.postal_address.postal_code
86+
br
87+
= User.human_attribute_name(@user.postal_address.country)
88+
- fields = ['tshirt_size', 'tshirt_cut']
7189
- fields.each do |field|
7290
- if @user.send(field).present?
7391
p

0 commit comments

Comments
 (0)