I want to return the id of the newly created object for my ajax call, instead of returning the view associated with the controller method.
You can do
render :text => @your_object.id
and then apply responseText to the integer in the javascript handler if necessary.
responseText
Yes, you can.
render :text=> "the text that you want to return"
Source: https://habr.com/ru/post/1305828/More articles:Retrieve HTTP header fields only on iPhone - httpConvert.ToSingle () for floating point data Type - c #Recommendation for game engine strategy for .NET? - .netPartially filled word matching algorithm - algorithmPython memory table - pythonInstallShield for WIX - installerCreating controls dynamically in MFC (collection issue) - dynamicautologue in authlogic Rails - ruby-on-railsSpecify intervals for location manager to transfer current location in Android - javaIs there a way to translate C code into Ruby? - cAll Articles