开发者

How do I pass layout false inside respond_to block in Rails?

开发者 https://www.devze.com 2023-02-05 13:30 出处:网络
I\'m trying to 开发者_StackOverflow中文版figure out how to make this work. Here is my code, which is not working right now:

I'm trying to 开发者_StackOverflow中文版figure out how to make this work. Here is my code, which is not working right now:

  respond_with(@addresses) do |format|
    format.json {render :json=>@addresses, :layout=>false}
  end


The :layout parameter shouldn't be necessary when you're rendering json, xml, etc.

0

精彩评论

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

关注公众号