Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda