satya
Thu Jul 25 2024
while using
For eg: if we want to accept file of type
Note: This will disable other file types in your local file dialog while enabling the image files only 🪄 .
#rails , #active-storage
form.file_field
for file attachments we can restrict the file type to any type if we want.For eg: if we want to accept file of type
image
then we can pass accept
attribute.
<%= form.file_field :picture, accept: "image/*" %>
Note: This will disable other file types in your local file dialog while enabling the image files only 🪄 .
#rails , #active-storage