阅读背景:

Rails渲染json时如何更改属性名称?

来源:互联网 

In my controller I have:

在我的控制器中,我有:

@pakkes = Pakke.where("navn like ?", "%#{params[:q]}%")

respond_to do |format|
  format.html # index.html.erb
  format.xml  { render :xml => @pakkes }
  format.json { render :json => @pakkes.map(&:attributes) }
end
@pakke



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: