When redirect Rails is not rendering html response on browser -
when try use method
def create @ticket = current_user.creator.build(ticket_params) if @ticket.save! flash[:success] = "thanks! i'll in touch soon!" redirect_to @ticket else render :root end end
it saves perfect ticket record in database. , return 'show' page's html response, but in browser still in same page.
the response , 2 request created method is:
my form:
= simple_form_for(@ticket, html: { class: 'form-horizontal', multipart: true }, remote: true) |f| #..... = f.submit 'criar ticket', class: 'btn btn-primary'
you setting remote true in form, therefore making javascript request. controller responding if html request redirecting. why setting remote true? if there's not reason remove remote: true
, things work.
Comments
Post a Comment