In my rails app we have a ajax ask to a server, to store some data. This
used to work but any problem, though now we get an
error:ActionController::UnknownFormat (ActionController::UnknownFormat):
app/controllers/reservations_controller.rb:45:in `create'As following is a
controller and my javascript record where we announce a datatype do be
JSONclass ReservationController < ApplicationController respond_to :html,
:jsondef create...respond_to do |format| if @reservation.save
format.html do redirect_to '/' finish format.json { news json:
@reservation.to_json } else news 'new' finish finish
endendfunction.js$.ajax({ url: url_link, dataType: 'json',
type: 'POST', data: dataToSend })
No comments:
Post a Comment