Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda