Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Form submit renders ajax partial showing code in text with Paperclip attachment

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 %>
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Issue was I was uploading in a modal, which requires gem remotipart.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!