Skip to content

Instantly share code, notes, and snippets.

View unRARed's full-sized avatar

Ryan Richardson unRARed

View GitHub Profile
@lorenadl
lorenadl / rails_active_storage_how_to_validate_file_type.md
Last active January 25, 2024 00:11
[Rails] Active Storage how to validate file type

Rails Active Storage how to restrict uploadable file types

Active Storage doesn't have validations yet.

We can restrict the accepted file types in the form:

<div class="field">
  <%= f.label :deliverable %>
 &lt;%= f.file_field :deliverable, direct_upload: true, 
@kazupon
kazupon / base.jade
Created March 9, 2012 17:20
jade template inheritance
!!! 5
html
head
h1 My Site
block scripts
script(src="/jquery.js")
body
block header
header
p some header content