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:

enter image description here

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -