[英]How Render json ruby on rails with array result
有:
def render
begin
array= [:orange => 1,:limon => 3]
rescue Exception => e
puts e
end
end
如何在一個json中返回數組
def render
begin
array= [:orange => 1,:limon => 3]
render :json => {:array => array},:callback => params[:callback]
rescue Exception => e
puts e
end
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.