How to send simple json response in Rails?

前端 未结 4 1960
一向
一向 2020-12-03 00:46

I need to send json response depends on user entered data in input, but I\'m failing to send simple json request.

I followed this article - http://paydrotalks.com/po

4条回答
  •  天命终不由人
    2020-12-03 01:40

    I usually use this method to return json data:

    msg = {:token => token, :courseId => courseId}
    render :json => msg
    

提交回复
热议问题