I would like to return the id of a 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 cast your responseText
to integer in the javascript handler if needed.
yes , you can .
render :text=> "the text that you want to return"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With