Can i return a value instead of a view from my controller?
I would like to return the id of a newly created object for my ajax call instead of returning the view associate开发者_StackOverflow社区d 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"
精彩评论