开发者

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"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜