Skip to content

Commit

Permalink
Display filename of existing artist profile picture
Browse files Browse the repository at this point in the history
Unlike in this commit [1], I've used the built-in
`ActionView::Helpers::FormBuilder#label` method rather than the
customized `TailwindFormBuilder#labels` method that I used for the file
fields in the album form. That's because at the moment there aren't any
validation rules on `Artist#profile_picture`, so we don't (yet) need to
be able to display validation errors withinin the label.

See #60.

[1]: 3aaec28
  • Loading branch information
floehopper committed Dec 22, 2023
1 parent c4f63fe commit d4c0e08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/views/artists/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<%= form.text_field :name, class: 'w-full mb-3' %>
<%= form.text_field :location, class: 'w-full mb-3' %>
<%= form.text_field :description, class: 'w-full mb-3' %>
<%= form.label :profile_picture %>
<% if form.object.profile_picture.attached? %>
<%= form.label :profile_picture, "Profile picture (#{form.object.profile_picture.filename})" %>
<% else %>
<%= form.label :profile_picture, "Profile picture" %>
<% end %>
<%= form.file_field :profile_picture, class: 'mb-3 block border border-slate-200 mb-6 file:mr-3 file:px-3 file:py-3 w-full file:border-0 file:bg-amber-600 hover:file:bg-amber-500 file:text-white' %>

<p class="mb-3">By creating an artist profile on jam.coop and
Expand Down

0 comments on commit d4c0e08

Please sign in to comment.