The files upload fine, and the form submission goes through with a Paperclip attachment, but the partial it's supposed to render through ajax shows up as text on a new page, instead of rendering the modal partial. Otherwise, without a Paperclip attachment, the form goes through normally as well, but the partial also renders normally. This is what shows up on the page, the code as text:
$("#actionEdit").html("Thank you, application received :) \n\n<br><br>\n\nYou will receive an Update regarding your application within one business day.\n");
And it shows up at http://localhost:3000/support_tickets.js which is wrong, should be just localhost. The pictures upload though, and the form submits normally. If there is no attachment, the page renders normally.
the form:
<div class="form-group">
<%= f.input :house_insurance_image, hint: "Upload a picture of your house insurance if you plan on holding an event at your house." %>
</div>
controller:
def create
@support_ticket = current_fan.support_tickets.build(support_ticket_params)
authorize @support_ticket, :create?
@fan = Fan.find(@support_ticket.fan_id)
respond_to do |format|
format.js
end
end
create.js
...
<% elsif @support_ticket.save %>
$("#actionEdit").html("<%= j render 'success' %>");
<% end %>
Issue was I was uploading in a modal, which requires gem remotipart.