Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tessa Davis
4,152 PointsAdding an attachment - not being added
I followed the two attachment videos but something ain't right. I am not getting any errors, but I can see that although it looks like I am attaching a file, it's not actually there when I look at the status in the console (document_id="nil").
My code in _form.html.erb is
<%= simple_form_for(@contact, html: {class: "form-inline well", multipart: true}, role: "form") do |f| %>
<%= f.fields_for :document do |document_fields| %>
<%= document_fields.input :attachment, as: :file %>
<% end %>
It all looks good but it's obviously not storing the file. Can anyone help?